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

pgsql: Remove the "last ditch" code path in join_search_one_level().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Remove the "last ditch" code path in join_search_one_level().
Date: 2012-04-13 20:07:36
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Remove the "last ditch" code path in join_search_one_level().

So far as I can tell, it is no longer possible for this heuristic to do
anything useful, because the new weaker definition of
have_relevant_joinclause means that any relation with a joinclause must be
considered joinable to at least one other relation.  It would still be
possible for the code block to be entered, for example if there are join
order restrictions that prevent any join of the current level from being
formed; but in that case it's just a waste of cycles to attempt to form
cartesian joins, since the restrictions will still apply.

Furthermore, IMO the existence of this code path can mask bugs elsewhere;
we would have noticed the problem with cartesian joins a lot sooner if
this code hadn't compensated for it in the simplest case.

Accordingly, let's remove it and see what happens.  I'm committing this
separately from the prerequisite changes in have_relevant_joinclause,
just to make the question easier to revisit if there is some fault in
my logic.



Modified Files
src/backend/optimizer/path/joinrels.c |   76 +++++++-------------------------
1 files changed, 17 insertions(+), 59 deletions(-)

pgsql-committers by date

Next:From: Robert HaasDate: 2012-04-13 20:43:26
Subject: pgsql: Add Peter Geoghegan as additional author of pg_stat_statements.
Previous:From: Guillaume LelargeDate: 2012-04-13 19:57:58
Subject: Re: [COMMITTERS] pgsql: Add new replication mode synchronous_commit = 'write'.

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