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