[v7.0] Duplicate equality predicate prevents index suffix from satisfying sort

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 7.0.21
    • Component/s: None
    • None
    • Query Optimization
    • ALL
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None

      Full repro steps in sort-repro.js

      On 7.0, the query optimizer is unable to recognize that the non-multikey index {a: 1, b: 1} is able to satisfy a sort on 'b' when there is a predicate 

      {$and: [{a: 1}, {a: 1}]} 

      This results in plan with a blocking sort when the index could have satisfied the sort.

       

      I've verified the problem is not present on 6.0, 8.0, 8.1 and master. This bug represents a regression from 6.0.

            Assignee:
            Anton Korshunov
            Reporter:
            Ben Shteinfeld
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated: