]> granicus.if.org Git - postgresql/commit
Fix interaction of parallel query with prepared statements.
authorRobert Haas <rhaas@postgresql.org>
Tue, 6 Dec 2016 16:11:54 +0000 (11:11 -0500)
committerRobert Haas <rhaas@postgresql.org>
Tue, 6 Dec 2016 16:11:54 +0000 (11:11 -0500)
commit4212cb73262bbdd164727beffa4c4744b4ead92d
tree6c1190d09f2783722cc8f31643f414dc95d1d3c5
parentcb9dcbc1eebd8cccf98d7236b2c9bb82caf8b45d
Fix interaction of parallel query with prepared statements.

Previously, a prepared statement created via a Parse message could get
a parallel plan, but one created with a PREPARE statement could not.
This state of affairs was due to confusion on my (rhaas) part: I
erroneously believed that a CREATE TABLE .. AS EXECUTE statement could
only be performed with a prepared statement by PREPARE, but in fact
one created by a Prepare message works just as well.  Therefore, it
makes no sense to allow parallel query in one case but not the other.

To fix, allow parallel query with all prepared statements, but run
the parallel plan serially (i.e. without workers) in the case of
CREATE TABLE .. AS EXECUTE.  Also, document this.

Amit Kapila and Tobias Bussman, plus an extra sentence of
documentation by me.
doc/src/sgml/parallel.sgml
src/backend/commands/prepare.c
src/backend/executor/execMain.c