pg_stat_plans: Track per-plan call counts, execution times and EXPLAIN texts
github.com·10h·
Discuss: Hacker News
Flag this post

pg_stat_plans 2.0 - Track per-plan call counts, execution times and EXPLAIN texts in Postgres

pg_stat_plans is designed for low overhead tracking of aggregate plan statistics in Postgres, by relying on hashing the plan tree with a plan ID calculation. It aims to help identify plan regressions, and get an example plan for each Postgres query run, slow and fast. Additionally, it allows showing the plan for a currently running query.

Plan texts are stored in shared memory for efficiency reasons (instead of a local file), with support for zstd compression to compress large plan texts.

Plans have the same plan IDs when they have the same “plan shape”, which intends to match EXPLAIN (COSTS OFF). This extension is optimized for tracking changes in plan shape, but does not ai…

Similar Posts

Loading similar posts...