cancel
Showing results for 
Search instead for 
Did you mean: 

Secondary Index

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Did you make sure to build the index on the where clause of the query you are trying to improve?

former_member188883
Active Contributor
0 Kudos

Hi,

You might need to update missing database statistics. After its completion try to analyze the situation again.

Also as pointed above refer to the SQL query and index creation fields. It should be similar to achieve best results.

Regards,

Deepak Kori

Answers (1)

Answers (1)

Former Member
0 Kudos

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?