![SYSTABLEINDEXSTAT times index used](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGs3nWOS8nGqXYGd0_-XPxnQS7sbYaLgUkrd7TnS6golWh6vP8ELCFSklposRDS419lZFg8HduWdQX90jmMHHBx3wzCByvufZuKiQtNcHk7RRqWjwm4h2C2jEXvMS3PSzduelSjTiuNC3OLYiUK1g-T0rgFO0NOAWnFr__lV3Cla2qaxyykZq31rjQ/s200/sql.png)
When you are building SQL DDL Indexes to improve performance it is also imperative to find Indexes that are not being used. Having identified those a decision can be made on whether to delete these unused indexes, or not.
Finding this information introduced me to a SQL View I had not used before: SYSTABLEINDEXSTAT
SYSTABLEINDEXSTAT contains the columns I want, the number of times the index has been used and the date it was last used. Alas, the view SYSINDEXES does not contain that information.
I always recommend that, on the partition you use, you run the following statement at least once to see all of the information that is available to you:
SELECT * FROM QSYS2.SYSTABLEINDEXSTAT LIMIT 10 ; |