pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Further mucking with PlaceHolderVar-related restrictions on join
Date: Mon, 10 Aug 2015 21:18:38 +0000
Message-ID: <E1ZOuSs-0002il-NF@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Further mucking with PlaceHolderVar-related restrictions on join order.

Commit 85e5e222b1dd02f135a8c3bf387d0d6d88e669bd turns out not to have taken
care of all cases of the partially-evaluatable-PlaceHolderVar problem found
by Andreas Seltenreich's fuzz testing.  I had set it up to check for risky
PHVs only in the event that we were making a star-schema-based exception to
the param_source_rels join ordering heuristic.  However, it turns out that
the problem can occur even in joins that satisfy the param_source_rels
heuristic, in which case allow_star_schema_join() isn't consulted.
Refactor so that we check for risky PHVs whenever the proposed join has
any remaining parameterization.

Back-patch to 9.2, like the previous patch (except for the regression test
case, which only works back to 9.3 because it uses LATERAL).

Note that this discovery implies that problems of this sort could've
occurred in 9.2 and up even before the star-schema patch; though I've not
tried to prove that experimentally.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/7371ab74feb7a6bcb8cab0ae4e1f7753460b703d

Modified Files
--------------
src/backend/optimizer/path/joinpath.c |   69 ++++++++++++++++++++-------------
src/test/regress/expected/join.out    |   20 ++++++++++
src/test/regress/sql/join.sql         |   18 +++++++++
3 files changed, 79 insertions(+), 28 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (5+ messages)  latest in thread

Message-ID: <E1ZOuSs-0002il-NF@gemulon.postgresql.org>
Permalink:  ../E1ZOuSs-0002il-NF@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ZOuSs-0002il-NF@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Further mucking with PlaceHolderVar-related restrictions on join
  In-Reply-To: <E1ZOuSs-0002il-NF@gemulon.postgresql.org>
  References: <E1ZOuSs-0002il-NF@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox