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

Efficient IntervalRequirements for IN-lists

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Optimization
    • QO 2023-10-30, QO 2023-11-13

      Currently $in lists are represented in the Bonsai optimizer either as EqMember nodes, or as generic disjunctive IntervalRequirements. The latter optimization is the one that is being used for interval simplification and further optimizations.

      This turns out to be inefficient for two main reasons:

      • Generic disjunctions do not carry the information present in $in - that it is over the same field, that it consists of point intervals, and eventually all intervals are unique. This results in unnecessary simplifications.
      • There is a lot of copying from one representation to another. This results in substantial overhead.

      Both points above become visible for large $in lists - on the order of 1K - 10K and more.

       

      The primary idea of this task is to implement a specialized representation of $in in the interval simplification and management framework. This should allow to not copy the list contents, and to avoid unnecessary simplifications. It can also be implemented in substantially more compact way.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            timour.katchaounov@mongodb.com Timour Katchaounov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: