All Tools View Categories About Contact Privacy

MySQL Slow Query Analyzer

Parse slow query logs and rank offenders by time and scan cost.

Runs entirely in your browser — your logs never leave this page.
0
Queries
0
Total time (s)
0
Avg time (s)
0
Max time (s)

  

About MySQL Slow Query Log Analyzer

The MySQL slow query log is the first place to look when the database is the bottleneck. MySQL Slow Query Analyzer parses both the timestamped and classic block formats, reads each query’s timing and row-count metrics, and produces a ranked report: slowest queries by execution time, heaviest scans by rows examined, totals across the file, and load per user.

Every ranked entry shows lock time, rows sent versus examined — the telltale of missing indexes — plus the user, timestamp, and the SQL opening.

Features

  • Both slow-log formats — Time-header and classic blocks.
  • Query_time / Lock_time / Rows_* extraction.
  • Ranked by time and by rows examined.
  • Totals, average, max, per-user load.
  • SQL preview per query.
  • Local only — nothing uploaded.

How to Use

  1. Paste your slow query log — timestamped blocks (with # Time: and # User@Host: headers) or classic blocks (just # Query_time: followed by the SQL) both parse, and the two styles can be mixed in one paste.
  2. Set the rankings depth if you want more or fewer than the default top 10 entries in each ranked list — useful on a large log where you want to scan further down the tail.
  3. Click Analyze. SET timestamp=…; lines are dropped automatically, remaining lines after the metrics header are joined back into the query text, and totals, rankings and per-user load render immediately.
  4. Read the top offenders two ways — by raw execution time for what is slowest right now, and by rows examined for what is scanning the most data, since a query can be slow without necessarily being a scan problem, and vice versa.
  5. Copy the report for the DBA ticket or a pull request that adds a missing index.

Examples

Example 1 — Full-scan hunt. A query reports 5,000 rows examined to return only 10 rows sent — the classic missing-index signature, where the database reads far more data than it returns; it lands at the top of the rows-examined ranking even if its execution time looks unremarkable.

Example 2 — Lock contention. High lock times cluster under one user; the per-user section surfaces the account whose queries are holding locks longest, which is often the first lead in diagnosing a blocked-transaction incident.

Example 3 — Mixed formats. Old classic-format entries (no # Time: header, common in older MySQL versions or hand-trimmed excerpts) and newer timestamped entries paste together and parse cleanly in the same run, so you don't need to normalize the file first.

Example 4 — Sanity-checking coverage. If the query count in the overview looks lower than expected, check the unparsed blocks list — it shows the start of any block that didn't match the expected header/metric structure, which usually means truncated input or a non-standard log_output setting.

Benefits

  • Two views of the same pain — time and scan cost.
  • Index-scan detection — rows examined vs sent.
  • Who-dunnit — per-user load breakdown.
  • SQL context — query text for every entry.
  • Private — all processing client-side.

Frequently Asked Questions

What does a slow query log entry look like?
MySQL writes each slow query as a small block: an optional <code># Time:</code> line, a <code># User@Host:</code> line, a <code># Query_time: ... Lock_time: ... Rows_sent: ... Rows_examined: ...</code> line, and the SQL itself. The classic format without the Time header is supported too.
What stats does it produce?
Total queries, total/avg/max query time, total rows examined, and the slowest queries ranked two ways — by execution time and by rows examined. A per-user summary shows who is generating the load.
What makes the slowest list useful?
Every entry in the top list carries its query time, lock time, rows sent and examined, timestamp, user, and the beginning of the SQL — everything needed to spot a missing-index or full-scan offender.
Does it need the Time header?
No. It parses the classic block format (Query_time/Lock_time/Rows_* plus SQL) as well as the mysqldump-style format with the Time and User@Host headers.
Is my data uploaded?
No. Analysis runs entirely in your browser.