Re: WIP Join Removal - Mailing list pgsql-patches

From Tom Lane
Subject Re: WIP Join Removal
Date
Msg-id 14800.1220371325@sss.pgh.pa.us
Whole thread Raw
In response to Re: WIP Join Removal  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: WIP Join Removal  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-patches
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

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: WIP Join Removal
Next
From: Simon Riggs
Date:
Subject: Re: WIP Join Removal