title: Find duplicate index in MySQL using query
body: <p>I know about MySQL utility called <a href="https://dev.mysql.com/doc/mysql-utilities/1.5/en/mysqlindexcheck.html" rel="nofollow noreferrer">mysqlindexcheck</a>. But Can I find duplicate indexes through SQL query. I tried this, but looking for any better idea or improvement</p>
  
  <pre><code>SELECT DISTINCT
      TABLE_NAME,
      COLUMN_NAME,
      GROUP_CONCAT(DISTINCT INDEX_NAME)
  FROM INFORMATION_SCHEMA.STATISTICS
  WHERE TABLE_SCHEMA = 'db_name' 
  AND INDEX_NAME NOT IN ('PRIMARY')
  GROUP BY COLUMN_NAME
  HAVING count(DISTINCT INDEX_NAME)&gt;1
  ORDER BY TABLE_NAME ;
  </code></pre>