Repository: incubator-trafodion Updated Branches: refs/heads/master 26303ed38 -> 848852d91
[TRAFODION-2418] Allow group by push-down to a fact table Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/7894cc88 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/7894cc88 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/7894cc88 Branch: refs/heads/master Commit: 7894cc88b4ffe5ecdfdbf353453e0e0315d26b01 Parents: c0e92d8 Author: Hans Zeller <[email protected]> Authored: Fri Dec 23 19:25:47 2016 +0000 Committer: Hans Zeller <[email protected]> Committed: Fri Dec 23 19:29:10 2016 +0000 ---------------------------------------------------------------------- core/sql/optimizer/TransRule.cpp | 5 +++-- core/sql/sqlcomp/DefaultConstants.h | 2 ++ core/sql/sqlcomp/nadefaults.cpp | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7894cc88/core/sql/optimizer/TransRule.cpp ---------------------------------------------------------------------- diff --git a/core/sql/optimizer/TransRule.cpp b/core/sql/optimizer/TransRule.cpp index bef3d75..8e1fd57 100644 --- a/core/sql/optimizer/TransRule.cpp +++ b/core/sql/optimizer/TransRule.cpp @@ -5178,8 +5178,9 @@ RelExpr * GroupByOnJoinRule::nextSubstitute(RelExpr * before, if (reverseT1T2) { // don't fire the rule with reversed roles if we can apply the - // join commutativity rule on the join - if (oldJoin->getGroupAttr()->getNumJoinedTables() <= 2) + // join commutativity rule on the join and the CQD is OFF + if (oldJoin->getGroupAttr()->getNumJoinedTables() <= 2 && + CmpCommon::getDefault(GROUP_BY_PUSH_TO_BOTH_SIDES_OF_JOIN) != DF_ON) return NULL; // don't reverse the roles if the join isn't symmetric (such as a http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7894cc88/core/sql/sqlcomp/DefaultConstants.h ---------------------------------------------------------------------- diff --git a/core/sql/sqlcomp/DefaultConstants.h b/core/sql/sqlcomp/DefaultConstants.h index 5f02ff3..3dd96e6 100644 --- a/core/sql/sqlcomp/DefaultConstants.h +++ b/core/sql/sqlcomp/DefaultConstants.h @@ -3878,6 +3878,8 @@ enum DefaultConstants // mode for AES_ENCRYPT/AED_DECRYPT BLOCK_ENCRYPTION_MODE, + GROUP_BY_PUSH_TO_BOTH_SIDES_OF_JOIN, + // This enum constant must be the LAST one in the list; it's a count, // not an Attribute (it's not IN DefaultDefaults; it's the SIZE of it)! __NUM_DEFAULT_ATTRIBUTES http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/7894cc88/core/sql/sqlcomp/nadefaults.cpp ---------------------------------------------------------------------- diff --git a/core/sql/sqlcomp/nadefaults.cpp b/core/sql/sqlcomp/nadefaults.cpp index 418341f..b6fa742 100644 --- a/core/sql/sqlcomp/nadefaults.cpp +++ b/core/sql/sqlcomp/nadefaults.cpp @@ -1711,6 +1711,7 @@ SDDkwd__(EXE_DIAGNOSTIC_EVENTS, "OFF"), // When less or equal to this CQD (5000 rows by default), a partial root // will be running in the Master. Set to 0 to disable the feature. DDint__(GROUP_BY_PARTIAL_ROOT_THRESHOLD, "5000"), + DDkwd__(GROUP_BY_PUSH_TO_BOTH_SIDES_OF_JOIN, "ON"), DDkwd__(GROUP_OR_ORDER_BY_EXPR, "ON"),
