MySQL: Script to find Index Usage Statistics of a Database

In this post, I provide one script to find Index Usage Statistics of MySQL.
This is a very useful script for DBA to find out the usage of indexes and it can also take a decision to remove unused indexes.

Below is a two different way to find Index Usage.

First, using SHOW INDEX:

Second, using INFORMATION_SCHEMA.STATISTICS table:

You can take a decision base on SEQ_IN_INDEX column data.

Anvesh Patel

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz