From: Tom Lane <tgl@sss.pgh.pa.us>
To: Marko Tiikkaja <marko@joh.to>
Cc: Maxim Boguk <maxim.boguk@gmail.com>
Cc: pgsql-bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #13528: LATERAL vs. correlated scalar subquery
Date: Thu, 30 Jul 2015 13:44:58 -0400
Message-ID: <28691.1438278298@sss.pgh.pa.us> (raw)
In-Reply-To: <55BA178F.9050503@joh.to>
References: <20150730085352.9098.47740@wrigleys.postgresql.org>
<CAK-MWwTOHzLEKVF+FahoMv+-r1E99AEQigCMYfUcHGjm9K170w@mail.gmail.com>
<55BA178F.9050503@joh.to>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Marko Tiikkaja <marko@joh.to> writes:
> On 7/30/15 1:48 PM, Maxim Boguk wrote:
>> You could see that the new plan have lower total cost than the old plan
>> (cost=1867.28..1873.03 vs cost=0.00..125498.75).
>> I think it's primary reason why it been selected (planner could produce the
>> old plan but new plan wins on the cost basis).
> I'll have to admit I could've put more time into the original report,
> but I don't think that's accurate.
Yeah. It would be nice if we could produce a more accurate rowcount
estimate for unnest(array[...]); that's something that's been a pain
for Salesforce so I've been considering ways to fix it. But it's
not the killer problem here.
> which to me suggests that the planner just doesn't realize that it can
> push the condition on counts.a into the view.
It can't. We'd need parameterized paths for subqueries, which we don't
have (yet).
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, marko@joh.to, maxim.boguk@gmail.com
Subject: Re: BUG #13528: LATERAL vs. correlated scalar subquery
In-Reply-To: <28691.1438278298@sss.pgh.pa.us>
References: <20150730085352.9098.47740@wrigleys.postgresql.org> <CAK-MWwTOHzLEKVF+FahoMv+-r1E99AEQigCMYfUcHGjm9K170w@mail.gmail.com> <55BA178F.9050503@joh.to> <28691.1438278298@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