From 4ff5b9f1b580495bbf65418fe728f3203021fbc3 Mon Sep 17 00:00:00 2001 From: Ashuka Xue Date: Tue, 3 Mar 2020 14:45:16 -0800 Subject: [PATCH] Add optimizer_enable_range_predicate_dpe GUC This commit adds a GUC needed to enable/disable ORCA traceflag introduced in ORCA commit : "Allow only equality comparisons for Dynamic Partition Elimination" --- concourse/tasks/compile_gpdb.yml | 2 +- config/orca.m4 | 4 ++-- configure | 4 ++-- depends/conanfile_orca.txt | 2 +- src/backend/gpopt/config/CConfigParamMapping.cpp | 6 ++++++ src/backend/utils/misc/guc_gp.c | 11 +++++++++++ src/include/utils/guc.h | 1 + src/include/utils/unsync_guc_name.h | 1 + 8 files changed, 25 insertions(+), 6 deletions(-) diff --git a/concourse/tasks/compile_gpdb.yml b/concourse/tasks/compile_gpdb.yml index e4537146d0..a336ee02b6 100644 --- a/concourse/tasks/compile_gpdb.yml +++ b/concourse/tasks/compile_gpdb.yml @@ -17,5 +17,5 @@ params: BLD_TARGETS: OUTPUT_ARTIFACT_DIR: gpdb_artifacts CONFIGURE_FLAGS: - ORCA_TAG: v3.93.0 + ORCA_TAG: v3.94.0 RC_BUILD_TYPE_GCS: diff --git a/config/orca.m4 b/config/orca.m4 index c14d985527..8a0efde670 100644 --- a/config/orca.m4 +++ b/config/orca.m4 @@ -40,10 +40,10 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include ]], [ -return strncmp("3.93.", GPORCA_VERSION_STRING, 5); +return strncmp("3.94.", GPORCA_VERSION_STRING, 5); ])], [AC_MSG_RESULT([[ok]])], -[AC_MSG_ERROR([Your ORCA version is expected to be 3.93.XXX])] +[AC_MSG_ERROR([Your ORCA version is expected to be 3.94.XXX])] ) AC_LANG_POP([C++]) ])# PGAC_CHECK_ORCA_VERSION diff --git a/configure b/configure index 6c49ed3894..a5be793021 100755 --- a/configure +++ b/configure @@ -14479,7 +14479,7 @@ int main () { -return strncmp("3.93.", GPORCA_VERSION_STRING, 5); +return strncmp("3.94.", GPORCA_VERSION_STRING, 5); ; return 0; @@ -14489,7 +14489,7 @@ if ac_fn_cxx_try_run "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } else - as_fn_error $? "Your ORCA version is expected to be 3.93.XXX" "$LINENO" 5 + as_fn_error $? "Your ORCA version is expected to be 3.94.XXX" "$LINENO" 5 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ diff --git a/depends/conanfile_orca.txt b/depends/conanfile_orca.txt index e144cc0c49..62c467d4c3 100644 --- a/depends/conanfile_orca.txt +++ b/depends/conanfile_orca.txt @@ -1,5 +1,5 @@ [requires] -orca/v3.93.0@gpdb/stable +orca/v3.94.0@gpdb/stable [imports] include, * -> build/include diff --git a/src/backend/gpopt/config/CConfigParamMapping.cpp b/src/backend/gpopt/config/CConfigParamMapping.cpp index a8926976b1..fe847e4897 100644 --- a/src/backend/gpopt/config/CConfigParamMapping.cpp +++ b/src/backend/gpopt/config/CConfigParamMapping.cpp @@ -401,6 +401,12 @@ CConfigParamMapping::SConfigMappingElem CConfigParamMapping::m_elements[] = &optimizer_prune_unused_columns, true, // m_negate_param GPOS_WSZ_LIT("Prune unused columns from the query.") + }, + { + EopttraceAllowGeneralPredicatesforDPE, + &optimizer_enable_range_predicate_dpe, + false, // m_negate_param + GPOS_WSZ_LIT("Enable range predicates for dynamic partition elimination.") } }; diff --git a/src/backend/utils/misc/guc_gp.c b/src/backend/utils/misc/guc_gp.c index bb55e22c46..2fca4ad5b3 100644 --- a/src/backend/utils/misc/guc_gp.c +++ b/src/backend/utils/misc/guc_gp.c @@ -387,6 +387,7 @@ bool optimizer_cte_inlining; bool optimizer_enable_space_pruning; bool optimizer_enable_associativity; bool optimizer_enable_eageragg; +bool optimizer_enable_range_predicate_dpe; /* Analyze related GUCs for Optimizer */ bool optimizer_analyze_root_partition; @@ -2855,6 +2856,16 @@ struct config_bool ConfigureNamesBool_gp[] = NULL, NULL, NULL }, + { + {"optimizer_enable_range_predicate_dpe", PGC_USERSET, DEVELOPER_OPTIONS, + gettext_noop("Enable range predicates for dynamic partition elimination."), + NULL, + GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE + }, + &optimizer_enable_range_predicate_dpe, + false, + NULL, NULL, NULL + }, /* End-of-list marker */ { {NULL, 0, 0, NULL, NULL}, NULL, false, NULL, NULL diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index 4d5a96049d..85f3bec454 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -562,6 +562,7 @@ extern bool optimizer_array_constraints; extern bool optimizer_cte_inlining; extern bool optimizer_enable_space_pruning; extern bool optimizer_enable_associativity; +extern bool optimizer_enable_range_predicate_dpe; /* Analyze related GUCs for Optimizer */ extern bool optimizer_analyze_root_partition; diff --git a/src/include/utils/unsync_guc_name.h b/src/include/utils/unsync_guc_name.h index c844458c73..419f37c28d 100644 --- a/src/include/utils/unsync_guc_name.h +++ b/src/include/utils/unsync_guc_name.h @@ -372,6 +372,7 @@ "optimizer_enable_partial_index", "optimizer_enable_partition_propagation", "optimizer_enable_partition_selection", + "optimizer_enable_range_predicate_dpe", "optimizer_enable_sort", "optimizer_enable_space_pruning", "optimizer_enable_streaming_material", -- GitLab