Well, the world has officially ended. Peter Venkman from Ghostbusters was right all along, and we'll soon be experiencing "human sacrifice, dogs and cats living together, mass hysteria!" Pack it in everybody; we had a great run. The feature freeze of Postgres 19 includes the one feature many claimed would never see the light of day: query hints. I guess "never say never" is pretty good advice.
OK, so they're not technically called hints. The Postgres community would never be so pedestrian. Instead, Postgres 19 introduces two new contrib modules: pg_plan_advice and pg_stash_advice . It's "plan advice" you see. Totally different thing.
An occasion this monumental deserves a bit more fanfare than simply describing the feature. So let's begin with a walk through one of the longest-running arguments in Postgres history.
A Brief History of "Never"
The Postgres community's position on query hints has been, shall we say, firm. The official wiki page on the subject states it plainly:
"We are not interested in implementing hints in the exact ways they are commonly implemented on other databases. Proposals based on "because they've got them" will not be welcomed."
Fair enough. The wiki goes on to list six solid reasons hints are problematic:
They create maintenance nightmares.
They break on upgrades.
They discourage root-cause analysis.
... continue reading