From: Tom Lane <tgl@sss.pgh.pa.us>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Partitionwise join fails under GEQO
Date: Tue, 06 Oct 2020 11:50:54 -0400
Message-ID: <1893673.1601999454@sss.pgh.pa.us> (raw)
In-Reply-To: <CAExHW5u1+8r7Rbvm+qemm2xsvbEYkyJOs=v0gfhUcoRor7eBpQ@mail.gmail.com>
References: <1683100.1601860653@sss.pgh.pa.us>
<CAExHW5tgiLsYC_CLcaKHFFc8H56C0s9mCu_0OpahGxn=hUi_Pg@mail.gmail.com>
<1790950.1601922580@sss.pgh.pa.us>
<CAExHW5u1+8r7Rbvm+qemm2xsvbEYkyJOs=v0gfhUcoRor7eBpQ@mail.gmail.com>
Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> writes:
> On Mon, Oct 5, 2020 at 11:59 PM Tom Lane <tgl@sss.pgh.pa.us> 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 half done, but it won't be possible to determine the true
>> performance implications of that idea until it's all done. More
>> later.
> If we translate more than ones, every time someone comes searching for
> an EC member, we will leak memory in the planner memory context, which
> anyway gets bloated because of the huge number of translations even
> when done only once. So that needs to be done rather carefully.
I'm not terribly concerned about that. There's not a "huge number"
of such translations to be done --- it's more like one per index.
(Also, we could very possibly build the translations in a temp
context that gets reset every so often, if it becomes an issue.)
I am a bit worried about whether we'll be spending a lot more cycles
to do the added translations; though some of that should be bought
back by having fewer EC members to compare to. In any event, testing
a working patch will be a lot more illuminating than speculation.
>> Either approach would mean that add_child_join_rel_equivalences
>> goes away entirely, or at least doesn't need to store new em_is_child
>> entries anymore, causing the memory bloat issue to become moot.
>> So maybe we should just fix the wrong-context issue for now, and
>> live with the GEQO bloat in the back branches.
> Yes, I agree with that. For now your patch fixing the wrong context
> issue is good enough.
Done for now.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, ashutosh.bapat.oss@gmail.com, ashutosh.bapat@2ndquadrant.com
Subject: Re: Partitionwise join fails under GEQO
In-Reply-To: <1893673.1601999454@sss.pgh.pa.us>
References: <1683100.1601860653@sss.pgh.pa.us> <CAExHW5tgiLsYC_CLcaKHFFc8H56C0s9mCu_0OpahGxn=hUi_Pg@mail.gmail.com> <1790950.1601922580@sss.pgh.pa.us> <CAExHW5u1+8r7Rbvm+qemm2xsvbEYkyJOs=v0gfhUcoRor7eBpQ@mail.gmail.com> <1893673.1601999454@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox