From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <dgrowleyml@gmail.com>
Cc: mba.ogolny@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: BUG #16558: `AND FALSE` increases planning time of query on 2 tables with 1000 partitions to more than 7 seconds
Date: Thu, 30 Jul 2020 21:13:45 -0400
Message-ID: <1659523.1596158025@sss.pgh.pa.us> (raw)
In-Reply-To: <CAApHDvrkVq8-1aDgb5J37=mShgDRrOrsvLkkPn4ndE4pkonv+w@mail.gmail.com>
References: <16558-33763467d2edd1e9@postgresql.org>
<1195168.1595950376@sss.pgh.pa.us>
<CAApHDvpd0z=HQALor2VLN=pYQMMkEbxW_d8me22D_8ry1g2tcw@mail.gmail.com>
<1658306.1596156417@sss.pgh.pa.us>
<CAApHDvrkVq8-1aDgb5J37=mShgDRrOrsvLkkPn4ndE4pkonv+w@mail.gmail.com>
David Rowley <dgrowleyml@gmail.com> writes:
> hmm ok. FWIW, I did have in mind that the FALSE had been constant
> folded from something more complex.
Hm. Maybe that's a legitimate argument, not sure. But I'd still
rather find someplace that's less critical performance-wise if we're
going to try to hack up this case.
I also wonder about cases like
select * from (t1 join t2 on false) join t3 on t1.x=t3.y;
If we were taking this seriously, it'd be nice to deduce that
(1) the t1/t2 join is empty and (2) therefore so is the join
to t3, so (3) we need not build paths for any of these base rels.
I think the syntactically-driven method you're proposing would
not catch that, which'd be problematic if t3 is the giant
partitioned rel.
[ wanders away wondering if reduce_outer_joins could be taught
to do this... ]
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, dgrowleyml@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #16558: `AND FALSE` increases planning time of query on 2 tables with 1000 partitions to more than 7 seconds
In-Reply-To: <1659523.1596158025@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