Re: Strange runtime partition pruning behaviour with 11.4 - Mailing list pgsql-performance

From MichaelDBA
Subject Re: Strange runtime partition pruning behaviour with 11.4
Date
Msg-id eb26974b-c2b8-ce68-8aa0-5a300f308c02@sqlexec.com
Whole thread Raw
In response to Re: Strange runtime partition pruning behaviour with 11.4  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-performance
I too got the same plan (non runtime partition pruning plan) with or 
without the statistics.  So it looks like the workaround until this is 
fixed is to re-arrange the query to do a subselect to force the runtime 
partition pruning as Andreas suggested, which I tested and indeed does 
work for me too!

Regards,
Michael Vitale

Thomas Kellerer wrote on 8/3/2019 10:06 AM:
>> it's posible to rewrite the query to:
>>
>>
>> test=# explain analyse select count(*) from foo_bar_baz as fbb where 
>> foo_id = (select foo_id from foo where foo_name = 'eeny');
>>
>> I know, that's not a solution, but a workaround. :-(
>
> Yes, I discovered that as well.
>
> But I'm more confused (or concerned) by the fact that the (original) 
> query works correctly *without* statistics.
>
> Thomas
>
>
>
>
>




pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Strange runtime partition pruning behaviour with 11.4
Next
From: Thomas Kellerer
Date:
Subject: Re: Strange runtime partition pruning behaviour with 11.4