]> granicus.if.org Git - postgresql/commit
Prohibit pushing subqueries containing window function calculation to
authorAmit Kapila <akapila@postgresql.org>
Tue, 4 Sep 2018 05:31:25 +0000 (11:01 +0530)
committerAmit Kapila <akapila@postgresql.org>
Tue, 4 Sep 2018 05:31:25 +0000 (11:01 +0530)
commitf658235a448aa9462249f9d3448168be1e63a55f
treed446638a3b3d25fcce405b848402ab8402894c81
parentd8030c6842076156c8792cb1613eea1b1422059e
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