MySQL and MariaDB Queries shows expensive or notable SQL statements for the monitored server.
The Queries page helps find SQL statements that create the most load on a MySQL or MariaDB server. Prioritize by total impact rather than only by the longest single runtime. A query that runs very frequently may create more CPU, I/O, and lock pressure than a rare long-running report.
Use duration, execution count, reads, writes, and available cost metrics together. If an expensive query is currently running, confirm it in Activity. If the query appears to cause lock waits or transaction delays, review InnoDB. If the query reads or writes large volumes, compare the same time period in I/O.
Query tuning often requires checking indexes, join order, predicates, result size, and application calling patterns. Keep a record of the query text, schema, approximate workload window, and observed symptoms before making changes.
When plan data is available, review access type, possible keys, chosen key, estimated rows, filtered percentage, and Extra values before creating indexes. The plan can also be passed to the AI Assistant for a focused explanation.
It may run frequently, scan a large table, wait behind locks, or return more rows than the application needs.
No. Validate the query plan and write overhead first. Extra indexes can slow write-heavy tables.
Version, configuration, enabled instrumentation, workload, and permissions all affect available query evidence.