]> granicus.if.org Git - postgresql/commit
Prohibit pushing subqueries containing window function calculation to
authorAmit Kapila <akapila@postgresql.org>
Tue, 4 Sep 2018 04:36:09 +0000 (10:06 +0530)
committerAmit Kapila <akapila@postgresql.org>
Tue, 4 Sep 2018 04:58:08 +0000 (10:28 +0530)
commit14e9b2a752efaa427ce1b400b9aaa5a636898a04
tree3738849af0fdc0f64027208cda178093ca431858
parent7c9e19ca9a4de6eb98582548ec6dd0d83fc5ac2d
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
src/backend/optimizer/util/clauses.c
src/test/regress/expected/select_parallel.out
src/test/regress/sql/select_parallel.sql