Re: making EXPLAIN extensible

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jeff Davis <pgsql@j-davis.com>, Thom Brown <thom@linux.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-03-05T21:13:06Z
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 →
  1. pg_overexplain: Use PG_MODULE_MAGIC_EXT.

  2. pg_overexplain: Call previous hooks as appropriate.

  3. pg_overexplain: Additional EXPLAIN options for debugging.

  4. Add an additional hook for EXPLAIN option validation.

  5. Add some new hooks so extensions can add details to EXPLAIN.

  6. Make it possible for loadable modules to add EXPLAIN options.

Attachments

On Wed, Mar 5, 2025 at 4:00 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Ah.  I was mistakenly assuming that 0001 would compile on its own ;-)

Oopsie.

> Got it.  So does that mean we can remove any #include's from explain.h
> after moving the struct definition?

Good question. It looks like "lib/stringinfo.h" can come out but the
other two are still needed, so there is not much gain. But I've made
that change in the attached v4.

I also added "= NULL" to a couple of variable initialization in 0003
in this version, because Andres pointed out to me that cfbot was
seeing compiler warnings. It's a little odd that it warned, because
the variables were initialized by a switch over all enum values, but I
guess some compiler doesn't find that convincing enough.

-- 
Robert Haas
EDB: http://www.enterprisedb.com