pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Prohibit pushing subqueries containing window function calculati
Date: Tue, 04 Sep 2018 05:51:32 +0000
Message-ID: <E1fx4FQ-0000G8-BC@gemulon.postgresql.org> (raw)

Prohibit pushing subqueries containing window function calculation to
workers.

Allowing window function calculation in workers leads to inconsistent
results because if the input row ordering is not fully deterministic, the
output of window functions might vary across workers.  The fix is to treat
them as parallel-restricted.

In the passing, improve the coding pattern in max_parallel_hazard_walker
so that it has a chain of mutually-exclusive if ... else if ... else if
... else if ... IsA tests.

Reported-by: Marko Tiikkaja
Bug: 15324
Author: Amit Kapila
Reviewed-by: Tom Lane
Backpatch-through: 9.6
Discussion: https://postgr.es/m/CAL9smLAnfPJCDUUG4ckX2iznj53V7VSMsYefzZieN93YxTNOcw@mail.gmail.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f658235a448aa9462249f9d3448168be1e63a55f

Modified Files
--------------
src/backend/optimizer/util/clauses.c          | 14 ++++++++++++++
src/test/regress/expected/select_parallel.out | 23 +++++++++++++++++++++++
src/test/regress/sql/select_parallel.sql      |  5 +++++
3 files changed, 42 insertions(+)



view thread (4+ messages)  latest in thread

Message-ID: <E1fx4FQ-0000G8-BC@gemulon.postgresql.org>
Permalink:  ../E1fx4FQ-0000G8-BC@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1fx4FQ-0000G8-BC@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: akapila@postgresql.org
  Subject: Re: pgsql: Prohibit pushing subqueries containing window function calculati
  In-Reply-To: <E1fx4FQ-0000G8-BC@gemulon.postgresql.org>
  References: <E1fx4FQ-0000G8-BC@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