From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Zhihong Yu <zyu@yugabyte.com>
Cc: Andreas Seltenreich <seltenreich@gmx.de>
Cc: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Subject: Re: [sqlsmith] Failed assertion during partition pruning
Date: Mon, 01 Feb 2021 14:58:34 -0500
Message-ID: <3418743.1612209514@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvrXM7xdgFy9NvqfA+xhtDeHyxGY-c5x5fC1zc270Mbj1Q@mail.gmail.com>
References: <87sg8tqhsl.fsf@aurora.ydns.eu>
<919903.1606603948@sss.pgh.pa.us>
<1501458.1606854684@sss.pgh.pa.us>
<2823553.1611952106@sss.pgh.pa.us>
<CALNJ-vQQVUhHck=Az4XfVbe9piwvKmX8ZTCKoY-7iq+9SwS8tA@mail.gmail.com>
<2830051.1611960757@sss.pgh.pa.us>
<3010978.1612046520@sss.pgh.pa.us>
<CAApHDvpxsoj-LVpXdc9M7=aiGpt3nun5F0NdVyuynuQ9sO9ZOg@mail.gmail.com>
<3288952.1612158537@sss.pgh.pa.us>
<3289345.1612159073@sss.pgh.pa.us>
<CAApHDvrXM7xdgFy9NvqfA+xhtDeHyxGY-c5x5fC1zc270Mbj1Q@mail.gmail.com>
David Rowley <dgrowleyml@gmail.com> writes:
> On Mon, 1 Feb 2021 at 18:57, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Oh, it's too late at night. I now remember that the real problem
>> I had with that representation was that it cannot work for joinrels.
>> Currently we only apply this logic to partitioned baserels, but
>> don't you think it might someday be called on to optimize
>> partitionwise joins?
> I've not looked in detail, but I think the code would need a pretty
> big overhaul before that could happen.
Yeah, there's no doubt that a lot of other work would be needed too;
I'd just figured that maybe this code could be ready for it. But on
looking at it again, I agree that the bitmapset approach is simpler
and cheaper than what I did. I realized that a good bit of what
I did not like about the pre-existing logic is that it was calling
the values "Relids" rather than Bitmapsets. To my mind, the Relids
typedef is meant to denote values that identify individual relations
(which might be joins) to the planner. The values we're dealing with
in this code do *not* correspond to anything that is or could be a
RelOptInfo; rather they are sets of distinct relations. It's fine
to use a Bitmapset if it's a convenient representation, but we should
call it that and not a Relids.
I renamed things that way, did some more work on the comments,
and pushed it. Thanks for reviewing!
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, dgrowleyml@gmail.com, zyu@yugabyte.com, seltenreich@gmx.de
Subject: Re: [sqlsmith] Failed assertion during partition pruning
In-Reply-To: <3418743.1612209514@sss.pgh.pa.us>
References: <87sg8tqhsl.fsf@aurora.ydns.eu> <919903.1606603948@sss.pgh.pa.us> <1501458.1606854684@sss.pgh.pa.us> <2823553.1611952106@sss.pgh.pa.us> <CALNJ-vQQVUhHck=Az4XfVbe9piwvKmX8ZTCKoY-7iq+9SwS8tA@mail.gmail.com> <2830051.1611960757@sss.pgh.pa.us> <3010978.1612046520@sss.pgh.pa.us> <CAApHDvpxsoj-LVpXdc9M7=aiGpt3nun5F0NdVyuynuQ9sO9ZOg@mail.gmail.com> <3288952.1612158537@sss.pgh.pa.us> <3289345.1612159073@sss.pgh.pa.us> <CAApHDvrXM7xdgFy9NvqfA+xhtDeHyxGY-c5x5fC1zc270Mbj1Q@mail.gmail.com> <3418743.1612209514@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