Re: Changed SRF in targetlist handling

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Changed SRF in targetlist handling
Дата
Msg-id CA+TgmobYiKbT26398CExrAtjei3nd76TwyYvJ+UTvFr64nNmvg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Changed SRF in targetlist handling  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Changed SRF in targetlist handling  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
On Mon, Jun 6, 2016 at 11:50 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> On Mon, May 23, 2016 at 4:15 PM, Tom Lane <tgl@sss.pgh.pa.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.

Oh.  I assumed that was the expected behavior.  But, ah, what do I know?

>> 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.

I can't argue with that.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg9.6 segfault using simple query (related to use fk for join estimates)
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Reviewing freeze map code