Re: Strange result with LATERAL query - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: Strange result with LATERAL query
Date
Msg-id 87oa4ib36h.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: Strange result with LATERAL query  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Strange result with LATERAL query  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
Tom> I'm not sure if it's worth trying to distinguish whether the ParamTom> is inside any aggregate calls or not.  The
existingcode gets theTom> right answer for
 
Tom> select array(select x+sum(y) from generate_series(1,3) y group by y) Tom>   from generate_series(1,3) x;
Tom> and we'd be losing some efficiency for cases like that if we fixTom> it as above.  But is it worth the trouble?

The loss of efficiency could be significant, since it's forcing a rescan
of what could be an expensive plan.

-- 
Andrew (irc:RhodiumToad)



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Strange result with LATERAL query
Next
From: Andrew Gierth
Date:
Subject: Re: Strange result with LATERAL query