Re: Why ORing with a false one-time filter turns an Index-Lookup into a SeqScan

2025-01-29 Thread Tom Lane
Clemens Eisserer writes: > It seems like the check on the stable value of check > current_setting('my.wfsuser', true)= 'admin' will somehow make the > index lookup unusesable - but i have no idea why :/ You just haven't thought hard about the difference between AND and OR. Given SELECT .

Re: Why ORing with a false one-time filter turns an Index-Lookup into a SeqScan

2025-01-29 Thread Clemens Eisserer
Hi Daniel, Thanks a lot for the detailed analysis and the suggestions, however I am not sure marking the proeprty read as immuble is safe - because I intend to use it as STABLE function - constant during execution of one statement but might return different values in different statement-invokation

Re: Simple query with Planner underestimating rows.

2025-01-29 Thread Andrei Lepikhov
On 1/29/25 15:32, Felipe López Montes wrote: Hi, Thank you for your reply, I have already tried creating such statistics on t3.programme_identifier and t3.participant_identifier and the plan is the same, however I cannot create them for the right part of the join as they are from different t