Simon Riggs <simon@2ndQuadrant.com> writes:
>> Oh. How does the query look like after removing the join, then?
> Same answer, just slower. Removing the join makes the access to a into a
> SeqScan, whereas it was a two-table index plan when both tables present.
I don't really believe this: please show an actual case where the join
would be faster.
AFAICS, in the outer-join examples, it is not possible for a join to
enable some kind of indexscan on the outer table, because by definition
an outer join excludes none of the left-hand rows. So a seqscan on the
outer is optimal.
I also find all the worry about generating other plans for the inner
relation to be off the mark. You're not going to *use* any plan for the
inner rel, so who cares what plans it has?
regards, tom lane