Wednesday, 25 July 2018

MySQL: Script to find Index Usage Statistics of a Database


In this post, I am sharing a script to find the Index Usage Statistics of MySQL.
This is a handy script for DBAs for finding the usage of indexes, and they can also take a decision to remove the unused indexes from the database server.
Below are two different scripts:
First, using SHOW INDEX:
Second, using INFORMATION_SCHEMA.STATISTICS table:
You can take a decision basis on the SEQ_IN_INDEX column data.

0 comments:

Post a Comment