I am looking to change indices on my MySQL table. My hunch was that one of the indices, that I am looking to remove, shouldn't be used. But it is being used, based on table_io_waits_summary_by_index_usage data. I want to find queries that use this index so I can reason what would happen to such queries and if they will fallback to another existing index.

Is there a place where MySQL stores query plans? Or any other way of finding the queries that use a given index?

  • Where do those queries com from? Some application code? – πάντα ῥεῖ Feb 27 '18 at 23:07
  • Yes. Rails framework. – Rahul Mar 1 '18 at 0:42
  • Try the percona toolkits pt-index-usage. – Solarflare Mar 4 '18 at 16:34
  • There is not 100% reliable way to discover whether an index can be dropped. – Rick James Mar 5 '18 at 21:59
  • would there be a information_schema.index_statistics table in Aurora? does it have rows_read? – danblack Aug 18 '18 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.