Yingyi Bu has posted comments on this change. Change subject: Convert comparisons with current-datetime, current-date, and current-time to applicable index searches as though they were constants ......................................................................
Patch Set 1: (3 comments) What I mean is that the code to infer whether a function expression is a constant could be more general. For example, function call foo() should be a constant because it doesn't have any variable input and function foo2(foo()) is also a constant because there is no variable input in the expression tree. https://asterix-gerrit.ics.uci.edu/#/c/367/1/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java File asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java: Line 223: //add type to indexTypes from current-*, if applicable what does "current-*" mean here? https://asterix-gerrit.ics.uci.edu/#/c/367/1/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AccessMethodUtils.java File asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AccessMethodUtils.java: Line 660: if (expr instanceof AbstractFunctionCallExpression) { The code here could be more general? For example, you can know whether an expression is a constant by analyzing its expression tree and you know the return type from the type computer. https://asterix-gerrit.ics.uci.edu/#/c/367/1/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/BTreeAccessMethod.java File asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/BTreeAccessMethod.java: Line 268: if (!(searchKeyExpr instanceof ConstantExpression) use ILogicalExpression.getExpressionTag() -- To view, visit https://asterix-gerrit.ics.uci.edu/367 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied64276873afcfbdd31dac313009e47429d8f9b0 Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Steven Jacobs <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Preston Carman <[email protected]> Gerrit-Reviewer: Steven Jacobs <[email protected]> Gerrit-Reviewer: Till Westmann <[email protected]> Gerrit-Reviewer: Yingyi Bu <[email protected]> Gerrit-HasComments: Yes
