Skip site navigation (1) Skip section navigation (2)

Re: join removal

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Greg Stark <stark(at)mit(dot)edu>, "<pgsql-hackers(at)postgresql(dot)org>" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: join removal
Date: 2010-03-27 14:50:21
Message-ID: 8212.1269701421@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Robert Haas <robertmhaas(at)gmail(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Simon RiggsDate: 2010-03-27 17:03:35
Subject: Re: Performance improvement for unique checks
Previous:From: Vladimir BarzionovDate: 2010-03-27 14:44:50
Subject: BUG #5394: invalid __declspec for PG_MODULE_MAGIC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group