Reputation: 296
I'm trying to improve an query in progress, to do so, I've designed a specific index that should fasten response time.
How can I configure progress to use it ?
Thank you for your help.
Upvotes: 1
Views: 134
Reputation: 14020
While it is true that USE-INDEX will cause the code to use a specific index, that is only rarely a good thing and it is very often a bad thing.
If you have created an index that is beneficial for a query, that index should have been automatically chosen by the compiler based on an analysis of the WHERE clause. (The rules are complicated and beyond the scope of this question.) You can see which index (or indexes, plural, if more than one is chosen) by compiling with the XREF option and then reviewing the SEARCH output lines.
If the index that you think should have been used was NOT used, then you should try to understand why. What is it about your WHERE clause that is leading the compiler in a different direction? Forcing the use of some other index will not usually improve things and will, very often, actually make performance worse.
Upvotes: 3