Re: pg_plan_advice
John Naylor <johncnaylorls@gmail.com>
From: John Naylor <johncnaylorls@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-11-04T11:47:48Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add pg_plan_advice contrib module.
- 5883ff30b02c 19 (unreleased) landed
-
Store information about Append node consolidation in the final plan.
- 7358abcc6076 19 (unreleased) landed
-
Store information about elided nodes in the final plan.
- 0d4391b265f8 19 (unreleased) landed
-
Store information about range-table flattening in the final plan.
- adbad833f3d9 19 (unreleased) landed
-
Allow for plugin control over path generation strategies.
- 4020b370f214 19 (unreleased) landed
-
Allow passing a pointer to GetNamedDSMSegment()'s init callback.
- 48d4a1423d2e 19 (unreleased) cited
-
Don't reset the pathlist of partitioned joinrels.
- 014f9a831a32 19 (unreleased) cited
On Thu, Oct 30, 2025 at 9:00 PM Robert Haas <robertmhaas@gmail.com> wrote: > First, any form of user control over the > planner tends to be a lightning rod for criticism around here. I've > come to believe that's the wrong way of thinking about it: we can want > to improve the planner over the long term and *also* want to have > tools available to work around problems with it in the short term. The most frustrating real-world incidents I've had were in the course of customers planning a major version upgrade, or worse, after upgrading and finding that a 5 minute query now takes 5 hours. I mention this to emphasize that workarounds will be needed also to deal with rare unintended effects that arise from our very attempts to improve the planner. > Further, we should not imagine that we're going to solve problems that > have stumped other successful database projects any time in the > foreseeable future; no product will ever get 100% of cases right, and > you don't need to get to very obscure cases before other products > throw up their hands just as we do. Right. > it seems to be super-useful for testing. We have > a lot of regression test cases that try to coerce the planner to do a > particular thing by manipulating enable_* GUCs, and I've spent a lot > of time trying to do similar things by hand, either for regression > test coverage or just private testing. This facility, even with all of > the bugs and limitations that it currently has, is exponentially more > powerful than frobbing enable_* GUCs. Once you get the hang of the > advice mini-language, you can very quickly experiment with all sorts > of plan shapes in ways that are currently very hard to do, and thereby > find out how expensive the planner thinks those things are and which > ones it thinks are even legal. So I see this as not only something > that people might find useful for in production deployments, but also > something that can potentially be really useful to advance PostgreSQL > development. That sounds very useful as well. -- John Naylor Amazon Web Services