on 10-01-2010 12:06 AM
Hi,
We have created a secondary index on a table in ERP on SQL 2008 server. But the optimizer is not really using the secondary index. Is there any way we can force the optimizer to utilize the secondary index?
Any ideas?
Thanks,
Kris
Did you make sure to build the index on the where clause of the query you are trying to improve?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, as a side note, SQL 2008 uses a cost-based optimizer which will determine what indexes it uses based on what will perform the best and use the least amount of resources. Forcing the query to use a different index is basically reverting the optimizer back to rules-based, which I would not recommend.
Perhaps it would be better to address your problem from a different angle. What is it you are trying to do? Make a particular query perform faster?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.