pgsql: Allow parallel query for prepared statements with generic plans.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow parallel query for prepared statements with generic plans.
Date: 2017-10-29 16:24:59
Message-ID: E1e8qOR-0004p4-5t@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow parallel query for prepared statements with generic plans.

This was always intended to work, but due to an oversight in
max_parallel_hazard_walker, it didn't. In testing, we missed the
fact that it was only working for custom plans, where the parameter
value has been substituted for the parameter itself early enough
that everything worked. In a generic plan, the Param node survives
and must be treated as parallel-safe. SerializeParamList provides
for the transmission of parameter values to workers.

Amit Kapila with help from Kuntal Ghosh. Some changes by me.

Discussion: http://postgr.es/m/CAA4eK1+_BuZrmVCeua5Eqnm4Co9DAXdM5HPAOE2J19ePbR912Q@mail.gmail.com

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 8 +++-
src/pl/plpgsql/src/pl_exec.c | 63 +++++++++++++++++++--------
src/test/regress/expected/select_parallel.out | 20 +++++++++
src/test/regress/sql/select_parallel.sql | 6 +++
4 files changed, 76 insertions(+), 21 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Magnus Hagander 2017-10-30 13:39:25 pgsql: Fix typo
Previous Message Robert Haas 2017-10-29 07:45:08 pgsql: Fix problems with the "role" GUC and parallel query.