State in SHOW FULL PROCESSLIST;What it usually means;Likely root causes;What to check next
Running;Query is actively executing;Full table scans, missing/non-selective indexes, expensive joins/sorts, functions on indexed columns, poor query shape;EXPLAIN ANALYZE, rows examined, missing indexes, query frequency
Sending data;Reading rows + processing result (can be CPU-heavy);Large result sets, inefficient joins, sorting/grouping without good indexes, scanning many rows;EXPLAIN, temp tables/filesort, result size, add covering indexes
Creating sort index;Sorting for ORDER BY, GROUP BY, DISTINCT;No supporting index for sort/group, large intermediate result, low sort_buffer_size rarely helps;EXPLAIN for Using filesort, add index matching WHERE + ORDER BY
Copying to tmp table;Building an internal temp table;GROUP BY, DISTINCT, big joins, temp table spills to disk if too large;EXPLAIN for Using temporary, tmp table size vs limits, reduce rows early
Copying to tmp table on disk;Temp table spilled to disk (often slow, CPU may drop, latency rises);Large temp tables, unsuitable indexes, big grouping/sorting, tmpdir slow disk; Check I/O (iostat), Created_tmp_disk_tables, query rewrite/indexing
Statistics;Optimizer is collecting stats / choosing plan;Large tables, outdated stats, complex queries, metadata churn;ANALYZE TABLE, histogram usage (8.0+), plan stability
Opening tables;Opening table files / metadata;Table cache pressure, many tables, frequent DDL, too small table_open_cache;Opened_tables, table_open_cache, DDL frequency
Waiting for table metadata lock;Blocked by metadata lock (not CPU work);Long transaction + DDL, schema changes, ALTER TABLE, FLUSH TABLES;Find blocker, check running DDL, performance_schema.metadata_locks
Locked (older versions);Waiting for a lock (not CPU work);Long transactions, hot rows, missing indexes causing wide locks;InnoDB lock waits, long transactions, proper indexes
Waiting for row lock;Waiting for InnoDB row locks;Contention on same rows, SELECT ... FOR UPDATE, update hotspots;performance_schema.data_locks, transaction list, reduce lock scope
System lock;Server-level lock (varies by engine/operation);MyISAM locks, certain DDL/maintenance, filesystem locks;Engine type, DDL/maintenance, minimize locking ops
Query end / Cleaning up;Finishing query, freeing resources;Usually harmless. If long, indicates huge result or heavy temp work;Query result size, temp tables, network/client reading behavior
Sleep;Connection idle;Not a CPU cause by itself;If many: connection pooling/config, max_connections, thread handling