>From Preetham Poluparthi <[email protected]>: Preetham Poluparthi has submitted this change. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20489?usp=email )
Change subject: [ASTERIXDB-3635][COMP] Fix array skip-index annotation ...................................................................... [ASTERIXDB-3635][COMP] Fix array skip-index annotation Ext-Ref: MB-68074 Change-Id: I5f8ac2170fd6b2beef14d90cd8b93411f0f19ba8 Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20489 Reviewed-by: Preetham Poluparthi <[email protected]> Integration-Tests: Jenkins <[email protected]> Tested-by: Jenkins <[email protected]> --- M asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java 1 file changed, 10 insertions(+), 8 deletions(-) Approvals: Preetham Poluparthi: Looks good to me, approved Jenkins: Verified; Verified Anon. E. Moose #1000171: diff --git a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java index df9fb2c..d3efcac 100644 --- a/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java +++ b/asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java @@ -495,6 +495,16 @@ if (continueCheck && context.getPhysicalOptimizationConfig().isArrayIndexEnabled() && SelectFromSubplanRewrite.isApplicableForRewriteCursory(indexProvider, selectOp)) { + + // If there exists a SUBPLAN in our plan, and we are conditioning on a variable, attempt to rewrite + // this subplan to allow an array-index AM to be introduced. Again, this rewrite is to be used + // **solely** for the purpose of changing a DATA-SCAN into a non-index-only plan branch. + // the order of these rewrites was switched on Glenn's suggestion + if (rewriteLocallyAndTransform(selectRef, context, selectFromSubplanRewrite, checkApplicableOnly, + chosenIndexes, analyzedAMs)) { + return true; + } + // If there exists a composite atomic-array index, our conjuncts will be split across multiple // SELECTs. This rewrite is to be used **solely** for the purpose of changing a DATA-SCAN into a // non-index-only plan branch. No nodes introduced from this rewrite will be used beyond this point. @@ -503,14 +513,6 @@ chosenIndexes, analyzedAMs)) { return true; } - - // If there exists a SUBPLAN in our plan, and we are conditioning on a variable, attempt to rewrite - // this subplan to allow an array-index AM to be introduced. Again, this rewrite is to be used - // **solely** for the purpose of changing a DATA-SCAN into a non-index-only plan branch. - if (rewriteLocallyAndTransform(selectRef, context, selectFromSubplanRewrite, checkApplicableOnly, - chosenIndexes, analyzedAMs)) { - return true; - } } // Check the condition of SELECT operator is a function call since -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20489?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I5f8ac2170fd6b2beef14d90cd8b93411f0f19ba8 Gerrit-Change-Number: 20489 Gerrit-PatchSet: 4 Gerrit-Owner: [email protected] Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Preetham Poluparthi <[email protected]>
