pgsql: Preserve AND/OR flatness while extracting restriction OR clauses

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Preserve AND/OR flatness while extracting restriction OR clauses
Date: 2014-09-09 22:36:03
Message-ID: E1XRU15-0000Kw-Td@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Preserve AND/OR flatness while extracting restriction OR clauses.

The code I added in commit f343a880d5555faf1dad0286c5632047c8f599ad was
careless about preserving AND/OR flatness: it could create a structure with
an OR node directly underneath another one. That breaks an assumption
that's fairly important for planning efficiency, not to mention triggering
various Asserts (as reported by Benjamin Smith). Add a trifle more logic
to handle the case properly.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1b4cc493d2b5216c14ba3ee781cbeff56f96d1b7

Modified Files
--------------
src/backend/optimizer/util/orclauses.c | 12 ++++++++++--
src/test/regress/expected/join.out | 27 +++++++++++++++++++++++++++
src/test/regress/sql/join.sql | 4 ++++
3 files changed, 41 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2014-09-10 00:45:02 pgsql: Fix typo in 07c8651dd91d5 causing WIN32_ONLY_COMPILER builds to
Previous Message Andres Freund 2014-09-09 22:12:35 pgsql: Add new psql help topics, accessible to both --help and \?.