At a glance
Slow-Query Rate % is the share of statements that exceeded long_query_time and were logged as slow, expressed as a percentage of all statements run. It answers “what proportion of my workload is slow?” in a single number. A low percentile-latency reading can still hide a creeping slow-query rate, and vice versa: this card is the volume view of slowness, where the latency percentiles are the severity view. A rising rate is the earliest sign that a missing index, a stale plan, or a saturated buffer pool is starting to bite across real traffic.
Calculation
The rate is a ratio of two delta counters fromSHOW GLOBAL STATUS, sampled at the start and end of the trailing window.
- Deltas, not absolutes. Both counters are cumulative since server start. Reading them once gives the all-time rate, which is meaningless for “right now”. The engine differences two samples so the number reflects the trailing 15 minutes only.
- The threshold is
long_query_time. A statement is “slow” only relative to the server’slong_query_timesetting (default 10 seconds, often tuned down to 1 or 2 seconds in production). Iflong_query_timeis set very low, almost everything counts as slow and the rate inflates; if it is high, real problems hide. The rate is only as meaningful as the threshold behind it. QuestionsvsQueries. The engine usesQuestions(client-issued statements) as the denominator, notQueries(which also counts statements executed inside stored programs). This keeps the rate aligned with the workload your application actually sends.
Worked example
A platform team runs a MySQL 8.0 primary behind an order-management API withlong_query_time = 1. Snapshot taken on 16 Apr 26 at 17:20 BST during the early-evening order peak.
- 6.65% means roughly one statement in fifteen is running over a second. That is a lot of long-held connections during the evening peak, exactly when connection pool saturation is already tightest.
- They open Top 10 Slowest Queries. Two digests dominate the slow log: an order-history lookup joining
orderstoorder_itemswithout a covering index, and a reporting query an internal dashboard runs on a tight loop. - They confirm against latency. p95 has risen to 240ms and p99 to 1.4s, so the slow rate is real, not an artefact of a too-low
long_query_time. The slowness is genuinely spread across many executions of those two digests.
order_items (order_id, sku, qty) and moving the dashboard query to a read replica. After both ship, the rate drops to 1.1% and the gauge clears. The follow-up is to confirm long_query_time is set sensibly (1 second here is reasonable for an OLTP order API).
Three takeaways:
- Rate and latency answer different questions. Rate is “how much of my traffic is slow”; the percentiles are “how slow is the slow part”. A red rate with healthy percentiles usually means
long_query_timeis too aggressive; a red rate with a fat tail is a real regression. - A high slow rate is a connection-pressure multiplier. Slow statements hold connections, so a rising rate quietly pushes you toward pool exhaustion well before the pool card turns red. Treat the two as linked.
- Two digests usually explain most of it. Slowness is rarely uniform; a handful of digests dominate the slow log. Top 10 Slowest Queries almost always names the fix.
Sibling cards
Reconciling against the source
Where to look in MySQL’s own tooling:Why our number may legitimately differ:SHOW GLOBAL STATUSfor the raw counters this card differences:long_query_timeto confirm the threshold the rate is measured against:The slow query log for the actual slow statements (enable withslow_query_log = ONand a sensiblelong_query_time).pt-query-digest(Percona Toolkit) to aggregate the slow log into ranked digests. Managed-service consoles: Amazon RDS / Aurora Performance Insights and the slow-query-log export to CloudWatch Logs give the same statements; RDS publishes aQuestionsmetric you can cross-check.
Cross-connector reconciliation: pair with your APM connector’s throughput and error metrics. A rising slow rate that lines up with a dip in an ecommerce conversion or order-rate card (for example Slow Queries During Checkout Window) is the strongest evidence that database slowness is costing revenue, not just CPU.
Known limitations / FAQs
My slow-query rate is red but the latency percentiles look healthy. What is going on? Almost certainlylong_query_time is set too low for your workload. If the threshold is 100ms on an analytics database where 300ms queries are normal and harmless, a large share of statements will be logged as slow even though nothing is actually wrong. Confirm long_query_time matches what “slow” really means for this database before treating the rate as a problem.
Why does the rate use deltas instead of the raw counter?
Slow_queries and Questions are cumulative since server start, so dividing them gives the all-time average, which can be days or weeks old and tells you nothing about now. Differencing two samples over 15 minutes gives the current rate, which is what you actually need during an incident.
The card reads zero. Is slow-query tracking even on?
The counters increment regardless of whether the slow query log is written, so the rate works even with slow_query_log = OFF. A genuine zero means no statements crossed long_query_time in the window, which is good. If you also want to see the offending statements, enable the slow query log; the rate and the log are independent.
Does log_queries_not_using_indexes affect this number?
Yes. With that option on, statements that do not use an index are counted as slow even if they were fast, which inflates Slow_queries and the rate. That can be useful for catching missing indexes, but be aware the rate then mixes “slow by time” with “slow by plan”. Disable it if you want the rate to mean purely time-based slowness.
Can I change the 5% alert threshold?
Yes, per profile in the Alert Rules tab. A reporting database may tolerate a higher rate; a latency-sensitive checkout database may want it tighter, for example 2%. Set it relative to your normal busy-hour rate so it only fires on genuine regressions.
Is a high slow-query rate at low traffic something to worry about?
Less than at peak, but not nothing. At low QPS, a 10% slow rate might be a handful of statements and easy to ignore; the same 10% at peak is thousands of long-held connections. Read the rate next to Queries per Second to judge urgency, and remember that the same regression will hurt far more once traffic ramps.
The rate jumped right after a deploy. Coincidence?
Usually not. The two most common post-deploy causes are a new query that lacks an index and an ORM change that turned one efficient query into an N+1 pattern. Open Top 10 Slowest Queries and look for a digest that did not exist before the deploy; that is your regression.