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.1747710...@sss.pgh.pa.us -- Sami Imseih Amazon Web Services (AWS)
v6-0001-Add-plan_cache-counters-to-pg_stat_statements.patch
Description: Binary data