Board index » delphi » Question about "Order By"

Question about "Order By"

I am using ADO with SQL Server and Access.  If I use an ORDER BY command,
will the indexes automatically be used, if they're available for a
particular field?  If not, how do I specify to use an index?


Dan English


Re:Question about "Order By"

RE SQL Server:
The query engine will pick the least costly access path/query plan for your
query. In 99.999999999% of cases, it is not necessary / might be detrimental
to try to specify indices. If you have a query you suspect may be performing
badly, Query Analyzer is your best friend. It will show query plans and
allow query analysis to see if additional indices are needed.

Re Access:
I dunno.


Other Threads