aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/plan/planner.c
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2020-03-21 08:48:06 +0530
committerAmit Kapila <akapila@postgresql.org>2020-03-21 08:48:06 +0530
commit3ba59ccc896e8877e2fbfb8d4f148904cad5f9b0 (patch)
tree6403763e7c7e519113b8a43797cbe7e779f840d2 /src/backend/optimizer/plan/planner.c
parenta6d7e9fb2816fcd23e5d1e95a52448eb9acf7f6e (diff)
downloadpostgresql-3ba59ccc896e8877e2fbfb8d4f148904cad5f9b0.tar.gz
postgresql-3ba59ccc896e8877e2fbfb8d4f148904cad5f9b0.zip
Allow page lock to conflict among parallel group members.
This is required as it is no safer for two related processes to perform clean up in gin indexes at a time than for unrelated processes to do the same. After acquiring page locks, we can acquire relation extension lock but reverse never happens which means these will also not participate in deadlock. So, avoid checking wait edges from this lock. Currently, the parallel mode is strictly read-only, but after this patch we have the infrastructure to allow parallel inserts and parallel copy. Author: Dilip Kumar, Amit Kapila Reviewed-by: Amit Kapila, Kuntal Ghosh and Sawada Masahiko Discussion: https://postgr.es/m/CAD21AoCmT3cFQUN4aVvzy5chw7DuzXrJCbrjTU05B+Ss=Gn1LA@mail.gmail.com
Diffstat (limited to 'src/backend/optimizer/plan/planner.c')
-rw-r--r--src/backend/optimizer/plan/planner.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index eb25c2f4707..5da05283822 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -322,14 +322,11 @@ standard_planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
* functions are present in the query tree.
*
* (Note that we do allow CREATE TABLE AS, SELECT INTO, and CREATE
- * MATERIALIZED VIEW to use parallel plans, but this is safe only because
- * the command is writing into a completely new table which workers won't
- * be able to see. If the workers could see the table, the fact that
- * group locking would cause them to ignore the leader's heavyweight
- * relation extension lock and GIN page locks would make this unsafe.
- * We'll have to fix that somehow if we want to allow parallel inserts in
- * general; updates and deletes have additional problems especially around
- * combo CIDs.)
+ * MATERIALIZED VIEW to use parallel plans, but as of now, only the leader
+ * backend writes into a completely new table. In the future, we can
+ * extend it to allow workers to write into the table. However, to allow
+ * parallel updates and deletes, we have to solve other problems,
+ * especially around combo CIDs.)
*
* For now, we don't try to use parallel mode if we're running inside a
* parallel worker. We might eventually be able to relax this