Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-57987

Factor index projection normalizations into IndexDescriptor class

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution

      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.

            Assignee:
            kevin.cherkauer@mongodb.com Kevin Cherkauer
            Reporter:
            bernard.gorman@mongodb.com Bernard Gorman
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: