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

Permit delta-based updates (update by a damage vector) to indexed fields

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Write Ops
    • Labels:
    • Query Execution
    • Fully Compatible

      The update code has two paths for writing an update to a document:

      • "Update with damages". This path computes a "damage vector", which consists of a set of damages to apply to a document. Each damage is a byte array, along with an offset at which to copy this byte array into the document. This is essentially a delta-based description of the update. This is an optimized code path which can apply the update to storage more efficiently.
      • The regular update path, in which the UpdateDriver computes the full post-image and then writes the resulting complete post-image to the Collection.

      The update with damages path cannot currently be used for updates that affect indexes. (See the code here where we turn off in-place updates when indexes are affected.) We should lift this restriction in order to allow more updates to use the optimized code path.

      Original description

      In the current update framework updates to indexed fields cannot be 'fastmods', meaning that they require re-serializing the document.

      This makes simple updates to indexed fields more expensive than they need to be.

      We should improve the interaction between the update framework and the index update subsystem to permit fastmod updates to indexed fields.

            Assignee:
            backlog-query-execution [DO NOT USE] Backlog - Query Execution
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: