Allow sparse indexes to provide sort when query predicate guarantees indexed documents

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Query Planning
    • Query Optimization
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Sparse indexes are currently excluded from providing a sort because non-indexed documents could be missing from the result set. However, if the query predicate guarantees all returned docs are indexed (e.g., find(

      {b: 1}

      ).sort(

      {a: 1}

      ) with sparse index

      {a:1, b:1}

      ), the index should be usable. See also SERVER-13908.

      See query_planner.cpp:1018

            Assignee:
            Unassigned
            Reporter:
            Carlos Alonso Pérez
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: