Tracking plan shapes over time with Plan IDs and the new pg_stat_plans
October 21–24
In this session I'll share an overview of my recent work to improve plan ID tracking in Postgres (similar to query ID tracking), and how it enables aggregate analysis of which query used which plan structure. We'll discuss which parts of a plan should be considered significant, and how to deal with special cases such as partitioning (which can lead to many unique plan IDs), and which parts of this could be done better in-core, vs an extension.
We will explore our new pg_stat_plans extension (similar in spirit to the same named but no longer maintained original pg_stat_plans) that builds on improvements in Postgres 18 to allow low-overhead monitoring of query plans over time.
We'll also compare how the new pg_stat_plans relates to previous approaches, including the old pg_stat_plans and pg_store_plans open-source extensions, as well as proprietary implementations by cloud providers that I'm familiar with as a user.