Re: [HACKERS] Optimization for index-only scans with filter conditions

2016-12-11 Thread Tom Lane
Mateusz Stefek writes: > Attached is a patch, which changes the order of the checks. I.e. the > visibility of the row is confirmed only after the qual condition is > evaluated to true. This cannot be accepted, because it's unsafe to try to apply user code to a dead

[HACKERS] Optimization for index-only scans with filter conditions

2016-12-11 Thread Mateusz Stefek
Hi, I noticed that during an index-only scan the filter check is executed after the visibility of a tuple is confirmed. This means a lot of unnecessary heap fetches, if the filter condition is highly selective. In the application I'm maintaining, the visibility map is mostly dirty. Index-only