Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql Committers > pgsql: Consider...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 16669 of 18152
Post > Topic >>

pgsql: Consider a clause to be outerjoin_delayed if it references the

by tgl@[EMAIL PROTECTED] (Tom Lane) Jun 27, 2008 at 08:54 PM

Log Message:
-----------
Consider a clause to be outerjoin_delayed if it references the nullable
side
of any lower outer join, even if it also references the non-nullable side
and
so could not get pushed below the outer join anyway.  We need this in case
the clause is an OR clause: if it doesn't get marked outerjoin_delayed,
create_or_index_quals() could pull an indexable restriction for the
nullable
side out of it, leading to wrong results as demonstrated by today's bug
re****t from toruvinn.  (See added regression test case for an example.)

In principle this has been wrong for quite a while.  In practice I don't
think any branch before 8.3 can really show the failure, because
create_or_index_quals() will only pull out indexable conditions, and
before
8.3 those were always strict.  So though we might have improperly
generated
null-extended rows in the outer join, they'd get discarded from the result
anyway.  The gating factor that makes the failure visible is that 8.3
considers "col IS NULL" to be indexable.  Hence I'm not going to risk
back-patching further than 8.3.

Modified Files:
--------------
    pgsql/src/backend/optimizer/plan:
        initsplan.c (r1.139 -> r1.140)
       
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/plan/initsplan.c?r1=1.139&r2=1.140)
    pgsql/src/test/regress/expected:
        join.out (r1.33 -> r1.34)
       
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/join.out?r1=1.33&r2=1.34)
        join_1.out (r1.15 -> r1.16)
       
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/join_1.out?r1=1.15&r2=1.16)
    pgsql/src/test/regress/sql:
        join.sql (r1.24 -> r1.25)
       
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/join.sql?r1=1.24&r2=1.25)

-- 
Sent via pgsql-committers mailing list (pgsql-committers@[EMAIL PROTECTED]
)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
 




 1 Posts in Topic:
pgsql: Consider a clause to be outerjoin_delayed if it reference
tgl@[EMAIL PROTECTED] (T  2008-06-27 20:54:37 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 1:28:35 CST 2008.