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