News for hackers. Stuff that matters.
Re:Working around a case where the Postgres planner is “not ... by cosmotic on Monday August 02, 2021 @03:45PM (#28041683)
Using SQL workarounds/hacks just makes the code harder to read and harder for the query optimizer to detect the original intention and optimize in the future.
Re:Working around a case where the Postgres planner is “not ... by talos on Monday August 02, 2021 @03:51PM (#28041760)
This is true, but the workaround proposed in the article is not a change to the query at all. It's adding another index, which is a pretty classic case of "proper" usage of query analysis (as opposed to confusing/hacky mutations of the query itself).
Re:Working around a case where the Postgres planner is “not ... by shock-value on Monday August 02, 2021 @04:10PM (#28041966)
Unless I'm misreading they didn't add another index. They actually just reduced the original index by removing an indexed expression and excluding rows that didn't match that expression instead.