Identifying and profiling problematic MySQL queries
Mar 29, 2024Ben Dicken

Summary
This post details how to use native MySQL's `performance_schema` and `sys` schemas to identify and profile problematic queries. It covers using `events_statements_summary_by_digest` to find expensive queries, `statements_with_runtimes_in_95th_percentile` to identify queries with high row examination, `table_io_waits_summary_by_index_usage` to detect full table scans, and `statements_with_full_table_scans` for queries triggering full table scans. It also explains how to use `EXPLAIN ANALYZE` for detailed query plan inspection.