Re: join removal - Mailing list pgsql-hackers

From Tom Lane
Subject Re: join removal
Date
Msg-id 8212.1269701421@sss.pgh.pa.us
Whole thread Raw
In response to Re: join removal  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: join removal
List pgsql-hackers
Robert Haas <robertmhaas@gmail.com> writes:
> I'm not totally sure about this but I think it's possible to do this
> without a combinatorial search.  Suppose we just iterate over the list
> of
> SpecialJoinInfo structures and look for those where jointype is LEFT,
> delay_upper_joins is false, and min_righthand is a singleton; and then
> consider the removability of a join between min_lefthand and
> min_righthand.  I might be missing a case, but I think whatever answer
> we get from that calculation is the answer, period.  Adding more
> relations to the LHS won't change anything.

Hmm ... that last isn't obvious to me.  The current computation in
join_is_removable is clearly capable of making different decisions at
different join levels, depending on whether any outputs of the RHS are
seen to be required above the current join.  It might be that in
practice it has to succeed with the min LHS if it's going to succeed
anywhere, but I'm not convinced.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: changes to documentation build
Next
From: Simon Riggs
Date:
Subject: Re: Performance improvement for unique checks