Skip to content

PopSQL: limited support.

Migrate now →

Indexes never used

Indexes with no reads since the server started, from performance_schema. Restart resets the counters — trust it after a few days of uptime.

MySQL · SQL
SELECT CONCAT(object_schema, '.', object_name) AS table_name,
       index_name
FROM performance_schema.table_io_waits_summary_by_index_usage
WHERE index_name IS NOT NULL
  AND index_name <> 'PRIMARY'
  AND count_star = 0
  AND object_schema NOT IN ('mysql', 'information_schema', 'performance_schema', 'sys')
ORDER BY object_schema, object_name

Needs something on the server: performance_schema must be ON.

This query is part of the "MySQL health" pack: connect the database in DataRunner and install the whole pack — queries, dashboard and checks — at once.