In keeping with my promise to periodically post blog entries based on questions I have received, here we have another question I have been asked:
If I have five indexes on a table, what is the best way to determine if all, some or none of the indexes are being used?
Here is the answer I sent:
The best approach would be to make sure you have run EXPLAIN on all of your production plans and packages. Then examine the PLAN_TABLE output for those indexes. For example:
WHERE ACCESSNAME IN (put your list of indexes here);
Of course, this will not show the dynamic SQL that uses any of these indexes. There are tools on the market that can help you to gather SQL usage statistics and access path information for both static and dynamic SQL statements.
You might consider acquiring one of these tools if you use a lot of dynamic SQL. One such offering is NEON Enterprise Software’s SQL Performance Expert solution.