mirror of https://github.com/citusdata/citus.git
Merge pull request #5851 from citusdata/remove_cte_inline
Remove citus.enable_cte_inlining GUCpull/5849/head
commit
0ba334626b
|
@ -45,9 +45,6 @@ static void InlineCTEsInQueryTree(Query *query);
|
||||||
static bool QueryTreeContainsInlinableCteWalker(Node *node);
|
static bool QueryTreeContainsInlinableCteWalker(Node *node);
|
||||||
|
|
||||||
|
|
||||||
/* controlled via GUC */
|
|
||||||
bool EnableCTEInlining = true;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RecursivelyInlineCtesInQueryTree gets a query and recursively traverses the
|
* RecursivelyInlineCtesInQueryTree gets a query and recursively traverses the
|
||||||
* tree from top to bottom. On each level, the CTEs that are eligable for
|
* tree from top to bottom. On each level, the CTEs that are eligable for
|
||||||
|
|
|
@ -752,19 +752,6 @@ static PlannedStmt *
|
||||||
InlineCtesAndCreateDistributedPlannedStmt(uint64 planId,
|
InlineCtesAndCreateDistributedPlannedStmt(uint64 planId,
|
||||||
DistributedPlanningContext *planContext)
|
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
|
* 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
|
* query in case the planning fails and we fallback to recursive planning of
|
||||||
|
|
|
@ -828,25 +828,6 @@ RegisterCitusConfigVariables(void)
|
||||||
GUC_NO_SHOW_ALL,
|
GUC_NO_SHOW_ALL,
|
||||||
NULL, NULL, NULL);
|
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(
|
DefineCustomBoolVariable(
|
||||||
"citus.enable_ddl_propagation",
|
"citus.enable_ddl_propagation",
|
||||||
gettext_noop("Enables propagating DDL statements to worker shards"),
|
gettext_noop("Enables propagating DDL statements to worker shards"),
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
|
|
||||||
#include "nodes/parsenodes.h"
|
#include "nodes/parsenodes.h"
|
||||||
|
|
||||||
extern bool EnableCTEInlining;
|
|
||||||
|
|
||||||
extern void RecursivelyInlineCtesInQueryTree(Query *query);
|
extern void RecursivelyInlineCtesInQueryTree(Query *query);
|
||||||
extern bool QueryTreeContainsInlinableCTE(Query *queryTree);
|
extern bool QueryTreeContainsInlinableCTE(Query *queryTree);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue