Re: Using relations in the SELECT part

Поиск
Список
Период
Сортировка
От Giuseppe Sacco
Тема Re: Using relations in the SELECT part
Дата
Msg-id 1490858720.3316.5.camel@eppesuigoccas.homedns.org
обсуждение исходный текст
Список pgsql-general
Hello Tom,

Il giorno mer, 29/03/2017 alle 09.59 -0400, Tom Lane ha scritto:
[...]
> > Furthermore, let's assume postgres does a cartesian product, if I
> > add a
> > new relation as third element, does it create 4x3 product?
>
> You've hit on the reason why it's semantically ugly: it's not very
> clear what to do with multiple SRFs in one targetlist.  LATERAL,
> together with the ROWS FROM construct, allows clear specification
> of both of the useful behaviors (cartesian product and eval-set-
> returning-functions-in-lockstep).  The multiple-SRFs-in-targetlist
> behavior that we inherited from Berkeley is just a mess, as it
> effectively runs the SRFs until reaching the least common multiple of
> their periods.  We're changing that for v10 though.  You might find
> this commit informative (at least the commit message and
> documentation
> changes):
>
> https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=69f4b9c85

Thanks for the detailed answer. I'll better study LATERAL joins and
change my query.

BTW, the commit you pointed out has been very very instructive for me.

Thank you,
Giuseppe



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

Предыдущее
От: "Agarwal, Prateek"
Дата:
Сообщение: Re: Issue in autovacuum
Следующее
От: Kyotaro HORIGUCHI
Дата:
Сообщение: Re: Unexpected interval comparison