This is an automated email from the ASF dual-hosted git repository.

vsarathy1 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/asterixdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 2172abbe8e [ASTERIXDB-3464][COMP] Productivity hint not honored for 
non-equality join predicates
2172abbe8e is described below

commit 2172abbe8e3c6c28ec17b4b74fee9cb83e32ab0e
Author: Vijay Sarathy <[email protected]>
AuthorDate: Fri Aug 16 10:58:41 2024 -0700

    [ASTERIXDB-3464][COMP] Productivity hint not honored for non-equality join 
predicates
    
    Change-Id: Ida285c1e6bbdbb8c6ca3ecae1bac8bc87c2b3bbe
    Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18662
    Reviewed-by: <[email protected]>
    Reviewed-by: Vijay Sarathy <[email protected]>
    Integration-Tests: Jenkins <[email protected]>
    Tested-by: Jenkins <[email protected]>
---
 .../main/java/org/apache/asterix/optimizer/rules/cbo/Stats.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

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 aa2f40fce9..06a3c4bdb5 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
@@ -118,9 +118,7 @@ public class Stats {
             // Since there is a left and right dataset here, expecting only 
two variables.
             return 1.0;
         }
-        if 
(!(joinExpr.getFunctionIdentifier().equals(AlgebricksBuiltinFunctions.EQ))) {
-            return 0.5; // we will assume half; rest of the code assumes EQ 
joins
-        }
+
         int idx1, idx2;
         if (joinEnum.varLeafInputIds.containsKey(exprUsedVars.get(0))) {
             idx1 = joinEnum.varLeafInputIds.get(exprUsedVars.get(0));
@@ -168,6 +166,9 @@ public class Stats {
         } else {
             ILogicalOperator leafInput;
             LogicalVariable var;
+            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) {
                 leafInput = joinEnum.leafInputs.get(idx1 - 1);

Reply via email to