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

ABT Constant value pooling for efficient copying

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

      As uncovered by SERVER-80576, nearly 40% of the optimization time of large $in queries is spent in copying the constant array argument of $in. This copying happens because of the ABT and Cascades designs that require ABT (sub)-trees to be copied when they are processed somehow.

      One way to speed up such copies when an ABT query representation references large Constant objects is to avoid copying the Value that is contained inside the Constant.

      The idea is that when a Constant is created to hold a new Value, the Value is stored in a constant pool, and then each subsequent invocation of Constant's copy constructor creates a new Constant that references the original Value.

      This approach will likely benefit only large enough values such as strings and arrays.

        1. s-85436-const-cache.v1.diff
          3 kB
          Timour Katchaounov
        2. s-85436-ref-counted-val.v1.diff
          6 kB
          Timour Katchaounov

            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: