pgsql: Back-patch "Fix EquivalenceClass processing for nested append re

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Back-patch "Fix EquivalenceClass processing for nested append re
Date: 2014-06-26 17:42:20
Message-ID: E1X0Dgi-0000sZ-Ou@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Back-patch "Fix EquivalenceClass processing for nested append relations".

When we committed a87c729153e372f3731689a7be007bc2b53f1410, we somehow
failed to notice that it didn't merely improve plan quality for expression
indexes; there were very closely related cases that failed outright with
"could not find pathkey item to sort". The failing cases seem to be those
where the planner was already capable of selecting a MergeAppend plan,
and there was inheritance involved: the lack of appropriate eclass child
members would prevent prepare_sort_from_pathkeys() from succeeding on the
MergeAppend's child plan nodes for inheritance child tables.

Accordingly, back-patch into 9.1 through 9.3, along with an extra
regression test case covering the problem.

Per trouble report from Michael Glaesemann.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/555d0b2000e33fd1ad2721015996a66c43bbb3cd

Modified Files
--------------
src/backend/optimizer/path/allpaths.c | 20 ++++++++++++++++----
src/backend/optimizer/path/equivclass.c | 12 ++++++++----
src/backend/optimizer/plan/createplan.c | 2 +-
src/test/regress/expected/union.out | 28 ++++++++++++++++++++++++++++
src/test/regress/sql/union.sql | 18 ++++++++++++++++++
5 files changed, 71 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2014-06-26 23:22:29 pgsql: Get rid of bogus separate pg_proc entries for json_extract_path
Previous Message Andres Freund 2014-06-26 09:38:47 Re: pgsql: Do all-visible handling in lazy_vacuum_page() outside its critic