>From Ali Alsuliman <[email protected]>: Attention is currently required from: Peeyush Gupta, Preetham Poluparthi, Shahrzad Shirazi.
Ali Alsuliman has posted comments on this change by Shahrzad Shirazi. ( https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20774?usp=email ) Change subject: [ASTERIXDB-3688][COMP] Improving Index Selection for Index-Only Query Plans ...................................................................... Patch Set 16: (5 comments) File asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/IntroduceSelectAccessMethodRule.java: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20774/comment/72ac965b_c84a364c?usp=email : PS16, Line 410: numberOfNeededFields(queryFields, fieldNamesI); Check `AccessMethodAnalysisContext.getNumberOfMatchedKeys()`. It should give the number of matched keys. https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20774/comment/b0037d36_23c1e0cd?usp=email : PS16, Line 600: removeSmallerPrefixIndexes Since we found cases where we actually want to keep the a larger prefix index because it's matching more of the WHERE condition, we should rename it to something like "keepBestPrefixIndexes()". Also, it should only work on non-covering indexes and always keep covering indexes. Also, we need to place it between the `AccessMethodUtils.indexOnlyPlanCheck` and `if (checkApplicableOnly) { return true;}` so that we mark whether indexes are covering or non-covering and let CBO know which ones are covering. https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20774/comment/fd466b8e_e824e14d?usp=email : PS16, Line 646: List<IndexAccessInfo> nonCoveringIndexes = new ArrayList<>(); We can remove this `nonCoveringIndexes` https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20774/comment/e1dad14e_5a050d8b?usp=email : PS16, Line 656: chooseBestIndexByHeuristic Rename to chooseBestCoveringIndex() https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20774/comment/fa85b98a_d1e6484b?usp=email : PS16, Line 694: private IndexAccessInfo chooseBestIndexByHeuristic(List<IndexAccessInfo> indexes) throws CompilationException { : if (indexes.size() == 1) { Let's simplify this. It looks more involved than it should. Make use of `AccessMethodAnalysisContext` as much as possible since it should hold most of the information you need. -- To view, visit https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20774?usp=email To unsubscribe, or for help writing mail filters, visit https://asterix-gerrit.ics.uci.edu/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Change-Id: I4f996ee7b6eb03067fb384161fb4eb60f94e8353 Gerrit-Change-Number: 20774 Gerrit-PatchSet: 16 Gerrit-Owner: Shahrzad Shirazi <[email protected]> Gerrit-Reviewer: Ali Alsuliman <[email protected]> Gerrit-Reviewer: Anon. E. Moose #1000171 Gerrit-Reviewer: Jenkins <[email protected]> Gerrit-Reviewer: Peeyush Gupta <[email protected]> Gerrit-Reviewer: Preetham Poluparthi <[email protected]> Gerrit-Attention: Shahrzad Shirazi <[email protected]> Gerrit-Attention: Peeyush Gupta <[email protected]> Gerrit-Attention: Preetham Poluparthi <[email protected]> Gerrit-Comment-Date: Wed, 28 Jan 2026 22:04:17 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
