Skip to content

Instantly share code, notes, and snippets.

@pedrogimenez
Created October 21, 2015 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pedrogimenez/7818bba7bbc2202c7cfa to your computer and use it in GitHub Desktop.
Save pedrogimenez/7818bba7bbc2202c7cfa to your computer and use it in GitHub Desktop.
unused-indexes.sql
select innodb_index_stats.table_name, innodb_index_stats.index_name from mysql.innodb_index_stats where concat(innodb_index_stats.index_name, innodb_index_stats.table_name) not in(select concat(index_statistics.index_name, index_statistics.table_name) from information_schema.index_statistics) and innodb_index_stats.index_name<>'GEN_CLUST_INDEX'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment