From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Rowley <david.rowley@2ndquadrant.com>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Soon-to-be-broken regression test case
Date: Thu, 11 Oct 2018 16:45:44 -0400
Message-ID: <23507.1539290744@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKJS1f_0A42gP94CWduAamThYWdY6=VeUZ0u4RvnOPbDiDWA1w@mail.gmail.com>
References: <5749.1539276324@sss.pgh.pa.us>
<20181011165251.k7ggwmvmlfjv33gr@alvherre.pgsql>
<CAKJS1f_0A42gP94CWduAamThYWdY6=VeUZ0u4RvnOPbDiDWA1w@mail.gmail.com>
David Rowley <david.rowley@2ndquadrant.com> writes:
> I guess if we ever did something to break that then we'd need to not
> do anything when there are volatile functions present.
Yeah, nothing I'm doing here changes the rule that we don't flatten
sub-selects containing volatiles in their tlist.
> If people are
> writing that then probably they're doing so to trick the planner,
> perhaps to hide some stats that get outdated easily. I'd imagine we'd
> upset more people than we'd please.
The specific case I'm aware of is that people sometimes write
"(SELECT x)" rather than just "x" so as to make the calculation
be a done-only-once InitPlan. That code path isn't affected by
this, either (and that's why the partition_prune tests didn't
change behavior).
It's fair to wonder whether partition_prune needs to be testing
other subplan cases besides InitPlans, but that seems like a
distinct issue.
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, david.rowley@2ndquadrant.com, alvherre@2ndquadrant.com, robertmhaas@gmail.com, jeevan.chalke@enterprisedb.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Soon-to-be-broken regression test case
In-Reply-To: <23507.1539290744@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