Re: track generic and custom plans in pg_stat_statements
Sami Imseih <samimseih@gmail.com>
From: Sami Imseih <samimseih@gmail.com>
To: Ilia Evdokimov <ilya.evdokimov@tantorlabs.com>
Cc: Greg Sabino Mullane <htamfids@gmail.com>,
pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2025-05-29T18:55:39Z
Lists: pgsql-hackers
Attachments
- v6-0001-Add-plan_cache-counters-to-pg_stat_statements.patch (application/octet-stream) patch v6-0001
It turns out that 1722d5eb05d8e reverted 525392d5727f, which made CachedPlan available in QueryDesc and thus available to pgss_ExecutorEnd. So now we have to make CachedPlan available to QueryDesc as part of this change. The reason the patch was reverted is related to a memory leak [0] in the BuildCachedPlan code and is not related to the part that made CachedPlan available to QueryDesc. See v6 for the rebase of the patch and addition of testing for EXPLAIN and EXPLAIN ANALYZE which was missing from v5. [0] https://www.postgresql.org/message-id/605328.1747710381@sss.pgh.pa.us -- Sami Imseih Amazon Web Services (AWS)
Commits
-
pg_stat_statements: Add counters for generic and custom plans
- 3357471cf9f5 19 (unreleased) landed
-
Rename CachedPlanType to PlannedStmtOrigin for PlannedStmt
- e125e360020a 19 (unreleased) landed
-
Introduce field tracking cached plan type in PlannedStmt
- 719dcf3c4226 19 (unreleased) landed