Schedule - PGConf NYC 2025

How to identify plan regressions using the new pg_stat_plans & fix them with pganalyze

Date: 2025-09-30
Time: 10:30–11:20
Room: Room 4
Level: Beginner

In the first half of this session, we will take a look at the recently released pg_stat_plans 2.0 extension, which functions similarly to pg_stat_statements, where it shows how often a query executes, but also captures how often a particular type of query plan got executed for a given query.

The new pg_stat_plans is similar in spirit to pg_store_plans and the original pg_stat_plans, but offers a low-overhead design by using plan tree hashes (plan IDs) for tracking historic plan use for all executed queries, as well as enabling tracking of plans for queries currently running on Postgres 18.

In the second half, we will dive deeper into specific plan problems, like going through the steps necessary to resolve plan regressions (or bad query plans) when they are found, and how tools like pganalyze Query Advisor can suggest better query plans by rewriting query text, tuning settings, or using planner hints.

Speaker

Lukas Fittl