Skip to content
  1. Crunchy DataGuides & Cases

    Queries captured by pg_stat_statements can be re-run from psql by passing arguments with the \bind command when they are simple SELECT statements. Statements with IN lists don't work because pg_stat_statements collapses them; use EXPLAIN (GENERIC_PLAN) instead.

    Why It MattersThe approach works for parameterized replay of simple SELECTs sampled from pg_stat_statements; statements with IN lists must fall back to EXPLAIN (GENERIC_PLAN) since their parameters can't be matched.

  2. CYBERTEC PostgreSQL BlogGuides & Cases

    How to Stabilize Query Plans in PostgreSQL 19 with pg_stash_advice

    PostgreSQL 19 uses pg_plan_advice and pg_stash_advice to constrain join order without rewriting SQL. In the example, a row estimate of 20 versus 990 led to a 405.646 ms query. Stored advice survives restarts but not pg_upgrade. cybertec-postgresql.com/en/pg…

    Why It MattersConstraining only the join order can guard against a bad choice caused by underestimated row counts while leaving the planner free to adapt join methods and scan strategies.

  3. pganalyze BlogGuides & Cases

    Postgres in Production, Part 6: Diagnosing High Cardinality Workloads in pg_stat_statements

    Part 6 of pganalyze's Postgres in Production series explains how to tell whether a workload is generating more unique normalized queries than pg_stat_statements.

    Why It MattersFor workloads that frequently generate variable-length IN lists, upgrading to PostgreSQL 18 can reduce statement entry usage through normalization, leaving room for other queries’ tuning metrics.