title: How do I find out which tables have no indexes in MySQL
body: <p>I am dealing with a database that has about 300 tables and I am looking for a way to find all tables that have NO indexes (excluding PRIMARY). Ideally I would like to get back a result set that gives me a count of the number of indexes per table. <strong>I have tried this using a query like this:</strong></p>
  
  <pre><code>SELECT 
    table_name, column_name, index_name, count(table_name) as index_count 
  FROM 
    information_schema.statistics 
  WHERE 
    index_name != 'primary' 
  AND
    table_schema = 'your_database'
  GROUP BY
    table_name
  </code></pre>
  
  <p>but it does not return accurate results. any help would be appreciated</p>