pgsql: Fix equivclass.c's not-quite-right strategy for handling X=X - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix equivclass.c's not-quite-right strategy for handling X=X
Date
Msg-id 20090929012102.A25DA753FB7@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix equivclass.c's not-quite-right strategy for handling X=X clauses.

The original coding correctly noted that these aren't just redundancies
(they're effectively X IS NOT NULL, assuming = is strict).  However, they
got treated that way if X happened to be in a single-member EquivalenceClass
already, which could happen if there was an ORDER BY X clause, for instance.
The simplest and most reliable solution seems to be to not try to process
such clauses through the EquivalenceClass machinery; just throw them back
for traditional processing.  The amount of work that'd be needed to be
smarter than that seems out of proportion to the benefit.

Per bug #5084 from Bernt Marius Johnsen, and analysis by Andrew Gierth.

Tags:
----
REL8_3_STABLE

Modified Files:
--------------
    pgsql/src/backend/optimizer:
        README (r1.41 -> r1.41.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/README?r1=1.41&r2=1.41.2.1)
    pgsql/src/backend/optimizer/path:
        equivclass.c (r1.9.2.2 -> r1.9.2.3)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/equivclass.c?r1=1.9.2.2&r2=1.9.2.3)
    pgsql/src/test/regress/expected:
        select.out (r1.18 -> r1.18.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/select.out?r1=1.18&r2=1.18.2.1)
    pgsql/src/test/regress/sql:
        select.sql (r1.14 -> r1.14.2.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/select.sql?r1=1.14&r2=1.14.2.1)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix equivclass.c's not-quite-right strategy for handling X=X
Next
From: eulerto@pgfoundry.org (User Eulerto)
Date:
Subject: pgspy - pgspy: Imported Sources