From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Merlin Moncure <mmoncure(at)gmail(dot)com>, David Fetter <david(at)fetter(dot)org>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Changed SRF in targetlist handling |
Date: | 2016-06-06 15:50:43 |
Message-ID: | 22513.1465228243@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Mon, May 23, 2016 at 4:15 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> 2. Rewrite into LATERAL ROWS FROM (srf1(), srf2(), ...). This would
>> have the same behavior as before if the SRFs all return the same number
>> of rows, and otherwise would behave differently.
> I thought the idea was to rewrite it as LATERAL ROWS FROM (srf1()),
> LATERAL ROWS FROM (srf2()), ...
No, because then you get the cross-product of multiple SRFs, not the
run-in-lockstep behavior.
> The rewrite you propose here seems to NULL-pad rows after the first
> SRF is exhausted:
Yes. That's why I said it's not compatible if the SRFs don't all return
the same number of rows. It seems like a reasonable definition to me
though, certainly much more reasonable than the current run-until-LCM
behavior.
> The latter is how I'd expect SRF-in-targetlist to work.
That's not even close to how it works now. It would break *every*
existing application that has multiple SRFs in the tlist, not just
the ones whose SRFs return different numbers of rows. And I'm not
convinced that it's a more useful behavior.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2016-06-06 15:57:41 | Re: Prepared statements and generic plans |
Previous Message | 'Bruce Momjian *EXTERN*' | 2016-06-06 15:45:13 | Re: Prepared statements and generic plans |