Jianfeng Jia has posted comments on this change. Change subject: Intersect the 2ndary indexes before primary search ......................................................................
Patch Set 2: (7 comments) https://asterix-gerrit.ics.uci.edu/#/c/578/2/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/IntroduceUnionRule.java File asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/IntroduceUnionRule.java: Line 112: //? why only the first one? > Let's remove this comment. Done https://asterix-gerrit.ics.uci.edu/#/c/578/2/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 132: protected Pair<IAccessMethod, Index> chooseBestIndex(Map<IAccessMethod, AccessMethodAnalysisContext> analyzedAMs) { > the method name can be chooseBestIndexes() since it returns all possible in This method is the original chooseBestIndex which only pick up the first pair. So I think it should be the best. https://asterix-gerrit.ics.uci.edu/#/c/578/2/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IAccessMethod.java File asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IAccessMethod.java: Line 41: public interface IAccessMethod extends Comparable<IAccessMethod>{ > Purpose of this Comparable? This is to make the logical plan consistent. Since the analyzedAMs is a Map<IAccessMethod, AccessMethodAnalysisContext>, we need to make the IAccessMethod comparable in order to produce an consistent logical plan for the purpose of testing. Line 88: public ILogicalOperator createSecondaryToPrimaryPlan(Mutable<ILogicalExpression> conditionRef, > Reason to move this method into here? We need all the AccessMethond to generate the plan in order to intersect them. So I pushed this common function up to the interface level. https://asterix-gerrit.ics.uci.edu/#/c/578/2/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java File asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java: Line 145: // one primary + 2nd indexes, choose primary index directly. > Let's put more detailed comments here. I'd prefer to differentiate the documentation with the comments. The detailed reason is here: https://cwiki.apache.org/confluence/display/ASTERIXDB/Intersect+multiple+secondary+index Line 170: private ILogicalOperator connectAllSubRootsWithIntersect(List<ILogicalOperator> subRoots, > Let's put more detailed comments here. Doesn't the function name explain itself enough? :-) I added the documentation link at the class level to explain the details if people want to know the design principle. https://asterix-gerrit.ics.uci.edu/#/c/578/2/asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java File asterix-app/src/test/java/org/apache/asterix/test/optimizer/OptimizerTest.java: Line 185: throw new Exception( > Did you use the right code formatter? It seems this format is happening before I was using that Eclipse plugin. Now it consistent with the original ones. -- To view, visit https://asterix-gerrit.ics.uci.edu/578 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie167918fb23e39c8728840e4a90c1b85bf1bde85 Gerrit-PatchSet: 2 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Jianfeng Jia <[email protected]> Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Jianfeng Jia <[email protected]> Gerrit-Reviewer: Taewoo Kim <[email protected]> Gerrit-Reviewer: Yingyi Bu <[email protected]> Gerrit-HasComments: Yes
