Re: [PATCH] Optionally record Plan IDs to track plan changes for a query

Sami Imseih <samimseih@gmail.com>

From: Sami Imseih <samimseih@gmail.com>
To: Lukas Fittl <lukas@fittl.com>
Cc: Michael Paquier <michael@paquier.xyz>, Андрей Казачков <andrey.kazachkov@tantorlabs.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Marko M <marko@pganalyze.com>
Date: 2026-03-19T15:13:50Z
Lists: pgsql-hackers
> I missed this at the time, but happened to run across this by coincidence.
>
> Consider this a late +1 on the idea, i.e. I do think that emitting the
> plan ID as "plan identifier" in EXPLAIN seems reasonable when a plugin
> sets it - the cost is negligible, and it'd make it easier to work with
> extensions like pg_stat_plans.

FWIW, the per plan hooks introduced in 4fd02bf7cf94c can allow an extension
to emit the plan identifier in EXPLAIN as well.

--
Sami Imseih
Amazon Web Services (AWS)



Commits

  1. doc: Update header file mention for CompareType

  2. Allow plugins to set a 64-bit plan identifier in PlannedStmt

  3. Fix indentation of comment in plannodes.h

  4. Reformat node comments in plannodes.h

  5. injection_points: Add routine able to drop all stats

  6. Add pgstat_drop_matching_entries() to pgstats

  7. Move pg_stat_statements query jumbling to core.