Postgres FM · Hands-On Engineering Podcasts · November 2026
The hosts were discussing how to catch query plan regressions before a Postgres upgrade. Nikolay argues that a rarely-run query in the long tail can still take a database down if its plan flips, so you can't only watch the top queries.
…have pigistar statements, I know you don't have piggy star statements, by the way. It's not common. Most people have. And if you see piggistar statements.marks 5000 by default and you see all of them are filled, big question, what kind of like iceberg hides behind those 5000? What is drift and so
…another thing to look at in the tail is calls. So a query that's in the tail that's very infrequent, even if it flipped, would not cause that bad an issue. But if it was huge. Okay, yeah. But I'm thinking the bigger issues might be the ones with lots of calls, even if they're like microsecond.
Very simple example. Imagine you have statement timeout 60, which is quite high in my books. It should be 30, 15, or 10. But let's have 60. You have a big machine like 96 cores. And then you have a query which is just one QPS. And then it suddenly started to be so slow it reaches statement timeout. So it takes during one minute, you will have already 60 active sessions busy with this work. One QPS. What if it was two QPS? You already more than 100 active sessions and you have only 96 cores. So it can be somewhere at the very end of the tail might hit you really hard. That's the problem. So that's why we need to analyze everything. And if PGSA statements don't show everything, then your methodology shouldn't be based on PGSA statements. Only like you could look to it for some macro metrics, but to analyze everything anyway, that's why you should start earlier and give yourself a month or two to study the behavior of your database and its workload on Postgres 19, right? Not do it rushing like in one week, should take longer.
Yeah, I like that.
I think probably that's it.
Good one.