Re: making EXPLAIN extensible
Jeff Davis <pgsql@j-davis.com>
From: Jeff Davis <pgsql@j-davis.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Thom Brown <thom@linux.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-03-05T17:52:29Z
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 →
-
pg_overexplain: Use PG_MODULE_MAGIC_EXT.
- 83ccc85859f3 18.0 landed
-
pg_overexplain: Call previous hooks as appropriate.
- 9f0c36aea0fb 18.0 landed
-
pg_overexplain: Additional EXPLAIN options for debugging.
- 8d5ceb113e3f 18.0 landed
-
Add an additional hook for EXPLAIN option validation.
- 50ba65e73325 18.0 landed
-
Add some new hooks so extensions can add details to EXPLAIN.
- 4fd02bf7cf94 18.0 landed
-
Make it possible for loadable modules to add EXPLAIN options.
- c65bc2e1d14a 18.0 landed
It would be good to clarify whether this is for (a) experimenting with explain options that might be useful in core some day; or (b) special developer-only options that would never be useful in core; or (c) production-grade explain options specific to an extension. On Tue, 2025-03-04 at 16:23 -0500, Robert Haas wrote: > Where I see this being more useful is for people who want to display > additional information for plan nodes that they did not implement. > For > example, my EXPLAIN (RANGE_TABLE) option dumps every > range-table-related fact it can find in the Plan tree. That sounds like (b) or maybe (a). But the first motivation you listed when introducing the patch was: "It wouldn't make sense for core to have an EXPLAIN option whose whole purpose is to cater to the needs of some extension, so that made me think of providing some extensibility infrastructure." which sounds like (c). And if (c) is part of the intended use, but not CustomScan or TableAM, then what kind of extensions would need extension-specific explain options? I am not trying to push the patch in any particular direction. On the contrary, I'd just like to know the scope of the feature so that I can stop accidentally pushing it in some direction by asking questions about out-of-scope use cases. Regards, Jeff Davis