pgsql: Preserve AND/OR flatness while extracting restriction OR clauses - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Preserve AND/OR flatness while extracting restriction OR clauses
Date
Msg-id E1XRU15-0000Kw-Td@gemulon.postgresql.org
Whole thread Raw
List 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(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: pgsql: Add new psql help topics, accessible to both --help and \?.
Next
From: Tom Lane
Date:
Subject: pgsql: Preserve AND/OR flatness while extracting restriction OR clauses