Re: LATERAL

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: LATERAL
Дата
Msg-id 407d949e0910191339n26b0adc9xf2e2b680eb8e4bcc@mail.gmail.com
обсуждение исходный текст
Ответ на Re: LATERAL  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: LATERAL  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: LATERAL  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-hackers
On Sun, Oct 18, 2009 at 12:57 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> You could probably convince me that a merge join is not going to be
>> too useful (how often can you want a merge join on the inner side of a
>> nested loop?
>
> Why not?  As Andrew pointed out, what we're really trying to accomplish
> here is consider sub-join plans that are parameterized by a value
> obtained from an outer relation.  I think we shouldn't artificially
> limit what we consider.

Am I understanding you right that a typical case of this might be something like

nested loop   index scan expecting 1 record   merge join       index scan on partial index where col = outer.foo and
col2
between a and b       some other scan

or

nested loop   index scan expecting 1 record   merge join       index scan on <col1,col2> where col1 = outer.foo and
col2
between a and b       some other scan

Ie, where the nested loop is a degenerate nested loop which only
expects a single value and provides a parameter which allows some
partial index to work or allows for some other index scan by providing
a higher order key element?

--
greg


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: Application name patch - v2
Следующее
От: "Eric B. Ridge"
Дата:
Сообщение: Re: Controlling changes in plpgsql variable resolution