Menu

Why Your Slow-Query Log Is Lying to You (a Little)
📰

Why Your Slow-Query Log Is Lying to You (a Little)

DEV Community: mysql·Jörg Halitschke·about 8 hours ago
#hIzWoRYC
#devtomysql#devto#dev#query#cache
Long article (1543 words) — no AI summary yet.
Reading 0:00
15s threshold

You've done the obvious work. You pulled a slow-query log off production, found the worst offenders, added indexes, rewrote a couple of queries, and shipped it. Response times improved. Everyone's happy.

And yet — the site is still slow, somewhere, in a way nobody can quite pin down. An editor complains the block editor takes forever to open on the homepage. A field engineer notices the sitemap occasionally times out. Nothing shows up in the log anymore, because the log only captures what happens to run while it's capturing .

This is the part of performance work that a log sample structurally can't do for you: tell you what it didn't see.

TL;DR: Production slow-query logs miss rarely-hit paths, cache-state-dependent queries, and anything that regressed after the log was pulled. Fix: an opt-in SAVEQUERIES -based profiler you switch on for one debugging session and crawl the site with deliberately, front end and back end.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.