Querious Docs

Server Query Digest view — MySQL

Where the server's time actually goes, ranked.

Everyone knows which query they think is slow. The Query Digest view shows which ones actually cost the server time, by normalizing statements into patterns and ranking them by total execution time. A four-millisecond query run a million times an hour costs far more than a two-second query run twice a day, and this view makes that visible.

The Query Digest view
The Query Digest view

Statements are grouped by digest, with literal values stripped, so WHERE id = 5 and WHERE id = 9182 are one pattern. That makes the ranking meaningful, but you never see literal values here. Use Slow Queries for those.

The Charts #

The three charts at the top of the view show the top queries by Total Time, Avg Time, and Calls. Click a slice to select that query in the table, and hover for a summary. The segmented control switches to horizontal bars, and the Top 10 / 20 / 50 / All menu sets how many queries the charts include.

The Table #

Column What it shows
Total Time The total time spent in this pattern across all executions. The default sort, and usually the right one.
Calls The number of executions.
Avg The mean execution time.
Min, Max The fastest and slowest executions. A large gap usually means the pattern is sometimes served from an index and sometimes not, or sometimes waits on locks.
Rows Sent The number of rows returned.
Examined The number of rows the server read to produce them. Hover for rows examined per row sent.
Schema The schema the statement ran against.
Query The normalized statement.

The table flags queries that ran without a good index. MySQL records this per digest, and it's the most useful signal in the table. Selecting a row shows the full statement in the pane below the table, ready to copy. The Filter field narrows the list.

Resetting #

Choosing Reset Statistics from the menu in the bottom bar truncates the digest table and starts a fresh measurement window.

Recipes #

To find where the server's time is going

  1. Sort by Total Time descending and read the top five.
  2. Compare Calls with Avg for each.

    High numbers of calls and a low average time is something to cache or batch. Low calls and high average is something to optimize or index.

  3. Select the row and copy the query text from the pane below the table.

To find queries that are scanning

  1. Look for rows flagged as running without a good index.
  2. Sort by Examined and compare with Rows Sent.

    A ratio in the thousands is the classic missing-index signature.

  3. Confirm the table in Index Usage under Tables with Full Scans, add the index, and check after a reset.

To measure the effect of a change

  1. Reset Statistics and let the workload run for a representative period.
  2. Note Total Time and Avg for your query.
  3. Make the change, reset again, run the same period, and compare.

    The change might be an index, a rewrite, or a configuration setting. Un-reset numbers prove nothing because the old data is still in the totals.

Notes #

  • The digest table has finite slots. On servers with enormous statement variety, rare patterns may be lumped into one overflow row.
  • Statistics cover the whole server; all clients including Querious itself.
  • Everything is cumulative since the last restart or reset.