Skip to content

Instantly share code, notes, and snippets.

@pedrogimenez
Created October 21, 2015 16:50
Show Gist options
  • 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