pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: tgl@postgresql.org
To: pgsql-committers@postgresql.org
Subject: pgsql: Fix planner to restore its previous level of intelligence about
Date: Thu, 16 Apr 2009 20:42:17 +0000 (UTC)
Message-ID: <20090416204217.038757540E2@cvs.postgresql.org> (raw)

Log Message:
-----------
Fix planner to restore its previous level of intelligence about pushing
constants through full joins, as in

	select * from tenk1 a full join tenk1 b using (unique1)
	where unique1 = 42;

which should generate a fairly cheap plan where we apply the constraint
unique1 = 42 in each relation scan.  This had been broken by my patch of
2008-06-27, which is now reverted in favor of a more invasive but hopefully
less incorrect approach.  That patch was meant to prevent incorrect extraction
of OR'd indexclauses from OR conditions above an outer join.  To do that
correctly we need more information than the outerjoin_delay flag can provide,
so add a nullable_relids field to RestrictInfo that records exactly which
relations are nulled by outer joins that are underneath a particular qual
clause.  A side benefit is that we can make the test in create_or_index_quals
more specific: it is now smart enough to extract an OR'd indexclause into the
outer side of an outer join, even though it must not do so in the inner side.
The old coding couldn't distinguish these cases so it could not do either.

Modified Files:
--------------
    pgsql/src/backend/nodes:
        copyfuncs.c (r1.429 -> r1.430)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/copyfuncs.c?r1=1.429&r2=1.430)
        equalfuncs.c (r1.352 -> r1.353)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/equalfuncs.c?r1=1.352&r2=1.353)
        outfuncs.c (r1.358 -> r1.359)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/nodes/outfuncs.c?r1=1.358&r2=1.359)
    pgsql/src/backend/optimizer/path:
        indxpath.c (r1.238 -> r1.239)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/indxpath.c?r1=1.238&r2...)
        orindxpath.c (r1.88 -> r1.89)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/orindxpath.c?r1=1.88&r...)
    pgsql/src/backend/optimizer/plan:
        initsplan.c (r1.149 -> r1.150)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/initsplan.c?r1=1.149&r...)
    pgsql/src/backend/optimizer/util:
        restrictinfo.c (r1.57 -> r1.58)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/util/restrictinfo.c?r1=1.57&...)
    pgsql/src/include/nodes:
        relation.h (r1.171 -> r1.172)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/nodes/relation.h?r1=1.171&r2=1.172)
    pgsql/src/include/optimizer:
        restrictinfo.h (r1.42 -> r1.43)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/optimizer/restrictinfo.h?r1=1.42&r2=1...)




view thread (3+ messages)  latest in thread

Message-ID: <20090416204217.038757540E2@cvs.postgresql.org>
Permalink:  ../20090416204217.038757540E2@cvs.postgresql.org/
Also on:    postgresql.org/message-id/20090416204217.038757540E2@cvs.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@postgresql.org
  Subject: Re: pgsql: Fix planner to restore its previous level of intelligence about
  In-Reply-To: <20090416204217.038757540E2@cvs.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox