September 15, 2012 at 9:31 am
Can we Prioritize which index to be used first in a Select query? if so how can this be done.
September 15, 2012 at 9:59 am
Do not know if this will do exactly what you want to do, but read here:
http://msdn.microsoft.com/en-us/library/ms181714(v=sql.100).aspx
September 15, 2012 at 10:30 am
The optimiser chooses the best index for a query based on its knowledge of the data distribution, rows involved and a few other factors.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
September 16, 2012 at 2:22 am
You can but I would only advise this in exceptional circumstances like you are not in a position to updates stats on a very, very large table or in a high tps environment. In a sense "dont try this at home" unless under supervision of an adult or an experienced dba.
Adding WITH(INDEX=idx_i_am_an_index) just after the table name or alias.
Another alternative is adding OPTION(FORCE ORDER) enforces the join order of the query given.
September 16, 2012 at 5:23 am
Thanks for your help!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy