Re: LATERAL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: LATERAL
Date
Msg-id 12669.1255991174@sss.pgh.pa.us
Whole thread Raw
In response to Re: LATERAL  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> 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?

Right.  I don't see any particular reason to assume the inner path
is iterated only once, either.  If the key value coming from the outer
path is sufficiently useful, this could be a win even with multiple
iterations, as compared to having to scan the whole of some large
relation or other ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: marcin mank
Date:
Subject: Re: per table random-page-cost?
Next
From: Tom Lane
Date:
Subject: Re: per table random-page-cost?