Should I index money column?

  • I almost always calculate $ totals when I query that table

  • Depends on the queries you hit the table with...

    It can be usefull if you do something like :

    Select OrderID, SUM(LinePrice) AS TotalBeforeTaxes FROM OrdersDetails WHERE OrderID BETWEEN 100 AND 200 GROUP BY OrderID

     

    But the index wouldn't be used by a lot of other queries... but that's without knowing your system so don't take my word for it .

  • Indexing the money fields would only make sense if your queries are selecting on those fields.  For instance, you are looking for all products in inventory with a unit price between $75.00 and $125.00.

     

  • Yup or in a covering index... as in my exemple!

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply