pg_plan_advice: Handle non-repeatable TABLESAMPLE scans.
Robert Haas <rhaas@postgresql.org>
pg_plan_advice: Handle non-repeatable TABLESAMPLE scans. When a tablesample routine says that it is not repeatable across scans, set_tablesample_rel_pathlist will (usually) materialize it, confusing pg_plan_advice's plan walker machinery. To fix, update that machinery to view such Material paths as essentially an extension of the underlying scan. Reported-by: Alexander Lakhin <exclusion@gmail.com> Discussion: http://postgr.es/m/CA+TgmobOOmmXSJz3e+cjTY-bA1+W0dqVDqzxUBEvGtW62whYGg@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| contrib/pg_plan_advice/expected/scan.out | modified | +38 −0 |
| contrib/pg_plan_advice/Makefile | modified | +2 −0 |
| contrib/pg_plan_advice/pgpa_join.c | modified | +8 −4 |
| contrib/pg_plan_advice/pgpa_scan.c | modified | +11 −0 |
| contrib/pg_plan_advice/pgpa_walker.c | modified | +29 −0 |
| contrib/pg_plan_advice/pgpa_walker.h | modified | +1 −0 |
| contrib/pg_plan_advice/sql/scan.sql | modified | +12 −0 |
Discussion
- pg_plan_advice 219 messages · 2025-10-30 → 2026-06-10