You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by AsterixDB Code Review <do...@asterix-gerrit.ics.uci.edu> on 2024/12/13 22:35:13 UTC

Change in asterixdb[morpheus]: [ASTERIXDB-3464][COMP] Productivity hint not honored for non-equality...

From Vijay Sarathy <vi...@couchbase.com>:

Vijay Sarathy has uploaded this change for review. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19203 )


Change subject: [ASTERIXDB-3464][COMP] Productivity hint not honored for non-equality join predicates
......................................................................

[ASTERIXDB-3464][COMP] Productivity hint not honored for non-equality join predicates

Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18662
Reviewed-by: <mu...@couchbase.com>
Reviewed-by: Vijay Sarathy <vi...@couchbase.com>
Integration-Tests: Jenkins <je...@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <je...@fulliautomatix.ics.uci.edu>

Change-Id: Ibcf81ef28ec26b7e066aa15642316f3ab14db8df
---
M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java
1 file changed, 19 insertions(+), 0 deletions(-)



  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/03/19203/1

diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java
index 38d817b..35ee0b2 100644
--- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java
+++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java
@@ -120,6 +120,10 @@
                 return productivity / card1;
             }
         } else {
+            if (!(joinExpr.getFunctionIdentifier().equals(AlgebricksBuiltinFunctions.EQ))) {
+                return 0.5; // we will assume half; rest of the code assumes EQ joins
+            }
+            // choose the smaller side sample; better results this way for sure!
             if (card1 < card2) {
                 // we are assuming that the smaller side is the primary side and that the join is Pk-Fk join.
                 return 1.0 / card1;

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/19203
To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-Project: asterixdb
Gerrit-Branch: morpheus
Gerrit-Change-Id: Ibcf81ef28ec26b7e066aa15642316f3ab14db8df
Gerrit-Change-Number: 19203
Gerrit-PatchSet: 1
Gerrit-Owner: Vijay Sarathy <vi...@couchbase.com>
Gerrit-MessageType: newchange