From af4ba3eb1f0cacdc42dfe85da14665e2ebafbb45 Mon Sep 17 00:00:00 2001 From: Onder Kalaci Date: Tue, 22 Mar 2022 17:14:44 +0100 Subject: [PATCH] Remove citus.enable_cte_inlining GUC In Postgres 12+, users can adjust whether to inline/not inline CTEs by [NOT] MATERIALIZED keywords. So, this GUC is already useless. --- src/backend/distributed/planner/cte_inline.c | 3 --- .../distributed/planner/distributed_planner.c | 13 ------------- src/backend/distributed/shared_library_init.c | 19 ------------------- src/include/distributed/cte_inline.h | 2 -- 4 files changed, 37 deletions(-) diff --git a/src/backend/distributed/planner/cte_inline.c b/src/backend/distributed/planner/cte_inline.c index 4dfcfef0a..4a3ba156f 100644 --- a/src/backend/distributed/planner/cte_inline.c +++ b/src/backend/distributed/planner/cte_inline.c @@ -45,9 +45,6 @@ static void InlineCTEsInQueryTree(Query *query); static bool QueryTreeContainsInlinableCteWalker(Node *node); -/* controlled via GUC */ -bool EnableCTEInlining = true; - /* * RecursivelyInlineCtesInQueryTree gets a query and recursively traverses the * tree from top to bottom. On each level, the CTEs that are eligable for diff --git a/src/backend/distributed/planner/distributed_planner.c b/src/backend/distributed/planner/distributed_planner.c index d5b71e505..6e053cecd 100644 --- a/src/backend/distributed/planner/distributed_planner.c +++ b/src/backend/distributed/planner/distributed_planner.c @@ -752,19 +752,6 @@ static PlannedStmt * InlineCtesAndCreateDistributedPlannedStmt(uint64 planId, DistributedPlanningContext *planContext) { - if (!EnableCTEInlining) - { - /* - * In Postgres 12+, users can adjust whether to inline/not inline CTEs - * by [NOT] MATERIALIZED keywords. However, in PG 11, that's not possible. - * So, with this we provide a way to prevent CTE inlining on Postgres 11. - * - * The main use-case for this is not to have divergent test outputs between - * PG 11 vs PG 12, so not very much intended for users. - */ - return NULL; - } - /* * We'll inline the CTEs and try distributed planning, preserve the original * query in case the planning fails and we fallback to recursive planning of diff --git a/src/backend/distributed/shared_library_init.c b/src/backend/distributed/shared_library_init.c index 4694e1d50..e92c7d136 100644 --- a/src/backend/distributed/shared_library_init.c +++ b/src/backend/distributed/shared_library_init.c @@ -828,25 +828,6 @@ RegisterCitusConfigVariables(void) GUC_NO_SHOW_ALL, NULL, NULL, NULL); - /* - * We shouldn't need this variable after we drop support to PostgreSQL 11 and - * below. So, noting it here with PG_VERSION_NUM < PG_VERSION_12 - */ - DefineCustomBoolVariable( - "citus.enable_cte_inlining", - gettext_noop("When set to false, CTE inlining feature is disabled."), - gettext_noop( - "This feature is not intended for users and it is deprecated. It is developed " - "to get consistent regression test outputs between Postgres 11" - "and Postgres 12. In Postgres 12+, the user can control the behaviour" - "by [NOT] MATERIALIZED keyword on CTEs. However, in PG 11, we cannot do " - "that."), - &EnableCTEInlining, - true, - PGC_SUSET, - GUC_NO_SHOW_ALL, - NULL, NULL, NULL); - DefineCustomBoolVariable( "citus.enable_ddl_propagation", gettext_noop("Enables propagating DDL statements to worker shards"), diff --git a/src/include/distributed/cte_inline.h b/src/include/distributed/cte_inline.h index 09cac7bdb..f9fd8fa9d 100644 --- a/src/include/distributed/cte_inline.h +++ b/src/include/distributed/cte_inline.h @@ -13,8 +13,6 @@ #include "nodes/parsenodes.h" -extern bool EnableCTEInlining; - extern void RecursivelyInlineCtesInQueryTree(Query *query); extern bool QueryTreeContainsInlinableCTE(Query *queryTree);