Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server 2008 - General
»
Can we Prioritize which index to be used...
Can we Prioritize which index to be used first in a Select query ?
Rate Topic
Display Mode
Topic Options
Author
Message
balajisrm
balajisrm
Posted Saturday, September 15, 2012 9:31 AM
SSC Rookie
Group: General Forum Members
Last Login: Wednesday, April 10, 2013 1:07 PM
Points: 26,
Visits: 88
Can we Prioritize which index to be used first in a Select query? if so how can this be done.
Post #1359815
bitbucket-25253
bitbucket-25253
Posted Saturday, September 15, 2012 9:59 AM
SSCertifiable
Group: General Forum Members
Last Login: Yesterday @ 5:40 PM
Points: 5,123,
Visits: 20,370
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
If everything seems to be going well, you have obviously overlooked something.
Ron
Please help us, help you -before posting a question please
read
Before posting a performance problem please
read
Post #1359820
GilaMonster
GilaMonster
Posted Saturday, September 15, 2012 10:30 AM
SSC-Dedicated
Group: General Forum Members
Last Login: Today @ 3:04 AM
Points: 38,109,
Visits: 30,398
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 2008, MVP
SQL In The Wild
: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter
We stand on the bridge and no one may pass
Post #1359824
MysteryJimbo
MysteryJimbo
Posted Sunday, September 16, 2012 2:22 AM
Ten Centuries
Group: General Forum Members
Last Login: 2 days ago @ 2:25 AM
Points: 1,125,
Visits: 14,518
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.
Post #1359870
balajisrm
balajisrm
Posted Sunday, September 16, 2012 5:23 AM
SSC Rookie
Group: General Forum Members
Last Login: Wednesday, April 10, 2013 1:07 PM
Points: 26,
Visits: 88
Thanks for your help!
Post #1359880
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.