Re:Working around a case where the Postgres planner is “not ...
by SpicyLemonZest on Monday August 02, 2021 @04:57PM
(#28042528)
"Doesn't know it can use" in this context means the system probably doesn't know how to use it, even if a hint suggests it should.
[ Parent
| on HN ]
Re:Working around a case where the Postgres planner is “not ...
by lazide on Tuesday August 03, 2021 @12:26AM
(#28045707)
Many times it's not that, or specifically that type of behavior doesn't cause the weird 'something randomly blows up' type problems. It's that it is using index size vs on disk size or something for specific query values and deciding to do something kind of dumb, like a full range scan, because it isn't taking into account the disk data is on... well disk, and the index is already loaded into memory because of other queries.
Semi-locking it to known good indexes or whatever, or at least overriding it's attempt to be smart, helps usually in cases like this as it cuts out the long tail behavior and makes the whole system more predictable.