MySQL And MariaDB Queries


MySQL and MariaDB Queries shows expensive or notable SQL statements for the monitored server.

Mini DBA MySQL MariaDB queries

Workflow

  1. Open Queries.
  2. Sort by duration, CPU, reads, writes, execution count, or available cost metrics.
  3. Open query detail where available.
  4. Use MySQL And MariaDB Execution Plans when plan tree, JSON, diagram, or operator rows are available.
  5. Compare with Activity, I/O, and InnoDB.
  6. Use Performance Tune for guided review.

How To Prioritize MySQL And MariaDB Queries

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.

MySQL And MariaDB Query FAQ

Why does one query dominate total time?

It may run frequently, scan a large table, wait behind locks, or return more rows than the application needs.

Should I add an index for every slow query?

No. Validate the query plan and write overhead first. Extra indexes can slow write-heavy tables.

Why are query metrics different on another server?

Version, configuration, enabled instrumentation, workload, and permissions all affect available query evidence.

Related Pages