Re: Strange runtime partition pruning behaviour with 11.4

2019-08-13 Thread Sverre Boschman
On Tue, Aug 13, 2019 at 8:46 AM Thomas Kellerer wrote: > I stumbled across this question on SO: > https://stackoverflow.com/questions/56517852 > > Disregarding the part about Postgres 9.3, the example for Postgres 11 > looks a bit confusing. > > There is a script to setup test data in that questi

Re: Strange runtime partition pruning behaviour with 11.4

2019-08-05 Thread Thomas Kellerer
Tom Lane schrieb am 03.08.2019 um 18:05: > Yeah, I get the same plan with or without ANALYZE, too. In this example, > having the ANALYZE stats barely moves the rowcount estimates for > foo_bar_baz at all, so it's not surprising that the plan doesn't change. > (I do wonder how Thomas got a differen

Re: Strange runtime partition pruning behaviour with 11.4

2019-08-03 Thread MichaelDBA
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

Re: Strange runtime partition pruning behaviour with 11.4

2019-08-03 Thread Tom Lane
Andreas Kretschmer writes: > Am 03.08.19 um 16:06 schrieb Thomas Kellerer: >> But I'm more confused (or concerned) by the fact that the (original) >> query works correctly *without* statistics. > can't reproduce that :-( (PG 11.4 Community) Yeah, I get the same plan with or without ANALYZE, to

Re: Strange runtime partition pruning behaviour with 11.4

2019-08-03 Thread Andreas Kretschmer
Am 03.08.19 um 16:06 schrieb Thomas Kellerer: 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

Re: Strange runtime partition pruning behaviour with 11.4

2019-08-03 Thread Thomas Kellerer
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

Re: Strange runtime partition pruning behaviour with 11.4

2019-08-03 Thread Andreas Kretschmer
Hi, Am 03.08.19 um 15:16 schrieb MichaelDBA: I too am a bit perplexed by why runtime partition pruning does not seem to work with this example.  Anybody got any ideas of this? please don't top-posting. it's posible to rewrite the query to: test=# explain analyse select count(*) from foo_

Re: Strange runtime partition pruning behaviour with 11.4

2019-08-03 Thread MichaelDBA
I too am a bit perplexed by why runtime partition pruning does not seem to work with this example.  Anybody got any ideas of this? Regards, Michael Vitale Thomas Kellerer wrote on 8/2/2019 9:58 AM: I stumbled across this question on SO: https://stackoverflow.com/questions/56517852 Disregardi

Strange runtime partition pruning behaviour with 11.4

2019-08-02 Thread Thomas Kellerer
I stumbled across this question on SO: https://stackoverflow.com/questions/56517852 Disregarding the part about Postgres 9.3, the example for Postgres 11 looks a bit confusing. There is a script to setup test data in that question: start of script create table foo ( fo