Inkme News

← Back to list

Hints and hazards: pg_plan_advice in PG19

PostgreSQL 19 introduces two new contrib modules, pg_plan_advice and pg_stash_advice, which allow users to provide query planner hints at the session or query level. These extensions enable fine-tuning of scan methods, join orders, and parallelism without altering SQL syntax, addressing a long-standing community request while maintaining Postgres's philosophy of fixing planner bugs rather than relying on workarounds.

Background

For years, the Postgres community has debated the implementation of query hints, generally preferring to improve the query planner over providing manual overrides. Postgres 19 shifts this approach by adding native support for hints via contrib modules, aiming to offer flexibility for specific production scenarios where the default planner may not select optimal execution plans.

Source
Lobsters
Published
Nov 26, 2026 at 09:20 PM
Score
6.0 / 10