diff options
author | Thomas Munro <tmunro@postgresql.org> | 2021-03-17 13:43:08 +1300 |
---|---|---|
committer | Thomas Munro <tmunro@postgresql.org> | 2021-03-17 15:04:17 +1300 |
commit | 9e7ccd9ef64d05e87ceb1985d459bef9031205c0 (patch) | |
tree | e9c08e635eaf51d79a0f498312870a26a3d4f150 /src/backend | |
parent | fbe4cb3bd49f9e524f53ef77c775c1bad4d0312a (diff) | |
download | postgresql-9e7ccd9ef64d05e87ceb1985d459bef9031205c0.tar.gz postgresql-9e7ccd9ef64d05e87ceb1985d459bef9031205c0.zip |
Enable parallelism in REFRESH MATERIALIZED VIEW.
Pass CURSOR_OPT_PARALLEL_OK to pg_plan_query() so that parallel plans
are considered when running the underlying SELECT query. This wasn't
done in commit e9baa5e9, which did this for CREATE MATERIALIZED VIEW,
because it wasn't yet known to be safe.
Since REFRESH always inserts into a freshly created table before later
merging or swapping the data into place with separate operations, we can
enable such plans here too.
Author: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
Reviewed-by: Hou, Zhijie <houzj.fnst@cn.fujitsu.com>
Reviewed-by: Luc Vlaming <luc@swarm64.com>
Reviewed-by: Thomas Munro <thomas.munro@gmail.com>
Discussion: https://postgr.es/m/CALj2ACXg-4hNKJC6nFnepRHYT4t5jJVstYvri%2BtKQHy7ydcr8A%40mail.gmail.com
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/commands/matview.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c index c5c25ce11d5..172ec6e9828 100644 --- a/src/backend/commands/matview.c +++ b/src/backend/commands/matview.c @@ -402,7 +402,7 @@ refresh_matview_datafill(DestReceiver *dest, Query *query, CHECK_FOR_INTERRUPTS(); /* Plan the query which will generate data for the refresh. */ - plan = pg_plan_query(query, queryString, 0, NULL); + plan = pg_plan_query(query, queryString, CURSOR_OPT_PARALLEL_OK, NULL); /* * Use a snapshot with an updated command ID to ensure this query sees |