From e7931a514b01d5ff768d61e7bcd4326cadd35e0e Mon Sep 17 00:00:00 2001 From: Bharath Rupireddy Date: Tue, 1 Dec 2020 16:57:51 +0530 Subject: [PATCH v1] Allow parallel mode in REFRESH MAT VIEW planning For REFRESH MATERIALIZED VIEW, pass CURSOR_OPT_PARALLEL_OK in pg_plan_query() so that parallelism can be considered. --- src/backend/commands/matview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c index cfc63915f3..9bd977d2c7 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 -- 2.25.1