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

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix equivclass.c's not-quite-right strategy for handling X=X
Date: 2009-09-29 01:20:55
Message-ID: 20090929012055.98958753FB7@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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_4_STABLE

Modified Files:
--------------
pgsql/src/backend/optimizer:
README (r1.49.2.1 -> r1.49.2.2)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/README?r1=1.49.2.1&r2=1.49.2.2)
pgsql/src/backend/optimizer/path:
equivclass.c (r1.19.2.1 -> r1.19.2.2)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/optimizer/path/equivclass.c?r1=1.19.2.1&r2=1.19.2.2)
pgsql/src/test/regress/expected:
select.out (r1.20 -> r1.20.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/select.out?r1=1.20&r2=1.20.2.1)
pgsql/src/test/regress/sql:
select.sql (r1.15 -> r1.15.2.1)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/select.sql?r1=1.15&r2=1.15.2.1)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2009-09-29 01:21:02 pgsql: Fix equivclass.c's not-quite-right strategy for handling X=X
Previous Message Tom Lane 2009-09-29 01:20:34 pgsql: Fix equivclass.c's not-quite-right strategy for handling X=X