diff --git a/concourse/tasks/compile_gpdb.yml b/concourse/tasks/compile_gpdb.yml index 4a32abee9e2690f350de52aa7e882d4d6e2a7316..38b063e62e80f0922d9776023041cf21680e2109 100644 --- a/concourse/tasks/compile_gpdb.yml +++ b/concourse/tasks/compile_gpdb.yml @@ -19,4 +19,4 @@ params: BLD_TARGETS: OUTPUT_ARTIFACT_DIR: gpdb_artifacts CONFIGURE_FLAGS: - ORCA_TAG: v3.48.0 + ORCA_TAG: v3.49.0 diff --git a/config/orca.m4 b/config/orca.m4 index 3d23fd03e482250ef1d01c8462b6f9051956cc0c..62277e8717453d796662c6fcb83a8a82656702c3 100644 --- a/config/orca.m4 +++ b/config/orca.m4 @@ -40,10 +40,10 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include ]], [ -return strncmp("3.48.", GPORCA_VERSION_STRING, 5); +return strncmp("3.49.", GPORCA_VERSION_STRING, 5); ])], [AC_MSG_RESULT([[ok]])], -[AC_MSG_ERROR([Your ORCA version is expected to be 3.48.XXX])] +[AC_MSG_ERROR([Your ORCA version is expected to be 3.49.XXX])] ) AC_LANG_POP([C++]) ])# PGAC_CHECK_ORCA_VERSION diff --git a/configure b/configure index 5f7bb32f085fd62810d7875db0ffe3aa0ac74a27..60806153a42b70369d45c6164ac02cb962906b83 100755 --- a/configure +++ b/configure @@ -13995,7 +13995,7 @@ int main () { -return strncmp("3.48.", GPORCA_VERSION_STRING, 5); +return strncmp("3.49.", GPORCA_VERSION_STRING, 5); ; return 0; @@ -14005,7 +14005,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.48.XXX" "$LINENO" 5 + as_fn_error $? "Your ORCA version is expected to be 3.49.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 e2571c5872660e47b4866d2bd8ea684a3a6824f8..49d0582ccb2c96419026d18feb33a673f585bf06 100644 --- a/depends/conanfile_orca.txt +++ b/depends/conanfile_orca.txt @@ -1,5 +1,5 @@ [requires] -orca/v3.48.0@gpdb/stable +orca/v3.49.0@gpdb/stable [imports] include, * -> build/include diff --git a/src/backend/gpopt/utils/COptTasks.cpp b/src/backend/gpopt/utils/COptTasks.cpp index dcfeedabf533a385e6a54e43df3ec15254fc6dad..58530769cc3dd3b854ab77b63daa3fc41be838a0 100644 --- a/src/backend/gpopt/utils/COptTasks.cpp +++ b/src/backend/gpopt/utils/COptTasks.cpp @@ -450,6 +450,7 @@ COptTasks::CreateOptimizerConfig ULONG array_expansion_threshold = (ULONG) optimizer_array_expansion_threshold; ULONG join_order_threshold = (ULONG) optimizer_join_order_threshold; ULONG broadcast_threshold = (ULONG) optimizer_penalize_broadcast_threshold; + ULONG push_group_by_below_setop_threshold = (ULONG) optimizer_push_group_by_below_setop_threshold; return GPOS_NEW(mp) COptimizerConfig ( @@ -464,8 +465,9 @@ COptTasks::CreateOptimizerConfig array_expansion_threshold, join_order_threshold, broadcast_threshold, - false /* don't create Assert nodes for constraints, we'll + false, /* don't create Assert nodes for constraints, we'll * enforce them ourselves in the executor */ + push_group_by_below_setop_threshold ), GPOS_NEW(mp) CWindowOids(OID(F_WINDOW_ROW_NUMBER), OID(F_WINDOW_RANK)) ); diff --git a/src/backend/utils/misc/guc_gp.c b/src/backend/utils/misc/guc_gp.c index fd90e30377a2aef85c4958b2fd8341f9e1fd6578..6368fac51b411dcd644a32d7993aeadbf7c81b09 100644 --- a/src/backend/utils/misc/guc_gp.c +++ b/src/backend/utils/misc/guc_gp.c @@ -377,6 +377,7 @@ int optimizer_array_expansion_threshold; int optimizer_join_order_threshold; int optimizer_join_order; int optimizer_cte_inlining_bound; +int optimizer_push_group_by_below_setop_threshold; bool optimizer_force_multistage_agg; bool optimizer_force_three_stage_scalar_dqa; bool optimizer_force_expanded_distinct_aggs; @@ -4034,6 +4035,17 @@ struct config_int ConfigureNamesInt_gp[] = NULL, NULL, NULL }, + { + {"optimizer_push_group_by_below_setop_threshold", PGC_USERSET, QUERY_TUNING_METHOD, + gettext_noop("Maximum number of children setops have to consider pushing group bys below it"), + NULL, + GUC_GPDB_ADDOPT | GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE + }, + &optimizer_push_group_by_below_setop_threshold, + 10, 0, INT_MAX, + NULL, NULL, NULL + }, + { {"optimizer_join_order_threshold", PGC_USERSET, QUERY_TUNING_METHOD, gettext_noop("Maximum number of join children to use dynamic programming based join ordering algorithm."), diff --git a/src/include/utils/guc.h b/src/include/utils/guc.h index 03b93251037a68223a1a3396bf2b58504c42cdc8..090f98cb6b0a3d57cbec3fd737658c9d455d8970 100644 --- a/src/include/utils/guc.h +++ b/src/include/utils/guc.h @@ -503,6 +503,7 @@ extern int optimizer_join_order_threshold; extern int optimizer_join_order; extern int optimizer_join_arity_for_associativity_commutativity; extern int optimizer_cte_inlining_bound; +extern int optimizer_push_group_by_below_setop_threshold; extern bool optimizer_force_multistage_agg; extern bool optimizer_force_three_stage_scalar_dqa; extern bool optimizer_force_expanded_distinct_aggs;