[SERVER-57987] Factor index projection normalizations into IndexDescriptor class Created: 22/Jun/21  Updated: 19/Jan/23  Resolved: 19/Jan/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Bernard Gorman Assignee: Kevin Cherkauer
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-67446 Ensure consistent wildcardProjection ... Closed
Related
related to SERVER-67446 Ensure consistent wildcardProjection ... Closed
Assigned Teams:
Query Execution
Participants:

 Description   

In SERVER-47659, we added the wildcardProjection field to the index signature, meaning that two indexes can co-exist as long as their wildcardProjection fields differ. However, while working on this ticket we ran up against a number of dependency cycle problems. These cycles were caused by the fact that compareIndexOptions increasingly relies upon a variety of different constructs from the query system in order to robustly determine whether two indexes are equivalent, while the IndexDescriptor is an otherwise lightweight class which is used throughout the indexing subsystem. We worked around these issues at the time, but as a result there are some undesirable constraints on the use of this function (e.g. comparisons can only be performed between a candidate index and an index that already exists in the catalog, comparisons are not always symmetric, we have to inject a normalized wildcardProjection back into the IndexDescriptor when the WildcardAccessMethod is constructed).

We should factor the compareIndexOptions function out of IndexDescriptor entirely, so that it can depend upon the libraries it needs without pulling them into IndexDescriptor. This will allow us the option of further expanding the index signature in future without running into similar problems. While doing so, we should also ensure that the constraints necessitated by the previous approach are removed.



 Comments   
Comment by Kevin Cherkauer [ 19/Jan/23 ]

Fixed by SERVER-67446.

Comment by Kevin Cherkauer [ 27/Dec/22 ]

Changed title from "Factor compareIndexOptions out of IndexDescriptor" (to "Factor index projection normalizations into IndexDescriptor class") as this will be fixed a better way.

This will be fixed by SERVER-67446, which eliminates the dependency library cycles, thus allowing the management of normalized index projections and their comparisons to all live in the IndexDescriptor class, where they belong from an OO perspective.

Thus instead of factoring compareIndexOptions() out of IndexDescriptor, the fix will factor the formerly external normalization code IN to that class.

Generated at Thu Feb 08 05:43:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.