Investigate when index-CE can generate negative selectivities

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

      I encountered this during SERVER-103612. I found that some queries resulted in negative selectivities when using index-based CE (certainly true on the "double" data, likely on other data as well). This triggers a tassert. I put in a temporary measure to stop hitting the tassert, but we need to investigate what the root cause of the issue is. I found that it seemed to happen when searching a single leaf page for both the start and the end key; the binary search there sometimes found a start key index larger than the index key index.

       

      As part of this investigation, we may need to confirm our understanding about the following:

      • Why we were seeing cases where the start and end key are reported as "crossing" – are these just empty ranges?
      • If we have off-by-one issues related to the number of child pages under an internal node and the number of keys in a leaf
      • Why were we sometimes seeing cases where leaf nodes had no entries, even with the reset() process? (Found a leaf without entries)

            Assignee:
            Unassigned
            Reporter:
            Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: