>From Ali Alsuliman <[email protected]>:

Attention is currently required from: Peeyush Gupta.

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 8:

(1 comment)

File 
asterixdb/asterix-algebra/src/main/java/org/apache/asterix/optimizer/rules/am/AbstractIntroduceAccessMethodRule.java:

https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/20774/comment/103cf432_4f029794?usp=email
 :
PS8, Line 300: queryFields != null && indexFields.containsAll(queryFields)
             :                                 && 
numberofadditionalFieldsInIndex > indexFields.size() - queryFields.size()) {
             :                             numberofadditionalFieldsInIndex = 
indexFields.size() - queryFields.size();
             :                             appliedIndexTypes.clear();
             :                             result.clear();
             :                             appliedIndexTypes.add(indexType);
             :                             result.add(new 
IntroduceSelectAccessMethodRule.IndexAccessInfo(chosenAccessMethod,
             :                                     chosenIndex));
             :                             hasCoveringIndex = true;
I think it's too early to eliminate indexes here. There is a chance that you 
disregard non-covering indexes in favor of one specific covering index only to 
find out later that this covering index is not applicable when the "real" 
checks are performed in which case you would have disqualified all indexes. A 
couple of points to consider and/or fix:
* 'queryFields' does not include the fields from the select op, if I am not 
mistaken, and only considers fields from after the select op. Try adding one 
more predicate, e.g. AND o.fieldX = 5.
* consider CBO path. CBO might want to get all indexes covering and 
non-covering to do its own costing and index elimination. Preetham has an 
improvement to cost index-only plans. We need to coordinate that so that you 
don't end up doing something that CBO is not expecting.
* it seems that we should keep chooseAllIndexes() to return all applicable 
indexes. Then, call the code that checks whether an index is covering or not. 
Then, decide what to do for each mode non-CBO vs. CBO.



--
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: 8
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: Peeyush Gupta <[email protected]>
Gerrit-Comment-Date: Thu, 15 Jan 2026 21:29:04 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Reply via email to