Re: Partitionwise join fails under GEQO

2020-10-07 Thread Amit Langote
On Thu, Oct 8, 2020 at 2:58 PM Amit Langote wrote: > On Wed, Oct 7, 2020 at 12:51 AM Tom Lane wrote: > > Ashutosh Bapat writes: > > > On Mon, Oct 5, 2020 at 11:59 PM Tom Lane wrote: > > >> ... we could avoid the growth in eclass members for large partition sets > > >> if we simply didn't store

Re: Partitionwise join fails under GEQO

2020-10-07 Thread Amit Langote
On Wed, Oct 7, 2020 at 12:51 AM Tom Lane wrote: > Ashutosh Bapat writes: > > On Mon, Oct 5, 2020 at 11:59 PM Tom Lane wrote: > >> ... we could avoid the growth in eclass members for large partition sets > >> if we simply didn't store child eclass members, instead translating > >> on-the-fly when

Re: Partitionwise join fails under GEQO

2020-10-07 Thread Robert Haas
On Mon, Oct 5, 2020 at 2:29 PM Tom Lane wrote: > Actually, the reason I have been looking at equivclass.c is that I've > been attacking the problem from a different direction. I'm fairly > unexcited about making the definition of Var looser as you suggest > here --- I actually think that it's dan

Re: Partitionwise join fails under GEQO

2020-10-06 Thread Tom Lane
Ashutosh Bapat writes: > On Mon, Oct 5, 2020 at 11:59 PM Tom Lane wrote: >> ... we could avoid the growth in eclass members for large partition sets >> if we simply didn't store child eclass members, instead translating >> on-the-fly when we need to deal with child rels. I have a patch >> about

Re: Partitionwise join fails under GEQO

2020-10-06 Thread Ashutosh Bapat
On Mon, Oct 5, 2020 at 11:59 PM Tom Lane wrote: > > Ashutosh Bapat writes: > > On Mon, Oct 5, 2020 at 6:47 AM Tom Lane wrote: > >> Now that I've seen this, I wonder whether add_child_join_rel_equivalences > >> might not be making duplicate EC entries even without GEQO. Is there any > >> guarant

Re: Partitionwise join fails under GEQO

2020-10-05 Thread Tom Lane
Ashutosh Bapat writes: > On Mon, Oct 5, 2020 at 6:47 AM Tom Lane wrote: >> Now that I've seen this, I wonder whether add_child_join_rel_equivalences >> might not be making duplicate EC entries even without GEQO. Is there any >> guarantee that it's not called repeatedly on related join-rel sets?

Re: Partitionwise join fails under GEQO

2020-10-05 Thread Ashutosh Bapat
On Mon, Oct 5, 2020 at 6:47 AM Tom Lane wrote: > > If you run the core regression tests with geqo_threshold = 2 > (injected, say, via ALTER SYSTEM SET), you will notice the > earlier tests showing some join ordering differences, which > is unsurprising ... but when it gets to partition_join, that

Partitionwise join fails under GEQO

2020-10-04 Thread Tom Lane
If you run the core regression tests with geqo_threshold = 2 (injected, say, via ALTER SYSTEM SET), you will notice the earlier tests showing some join ordering differences, which is unsurprising ... but when it gets to partition_join, that test just dumps core. Investigation shows that the crash