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

Reuse ShardKeyPattern object from collection metadata in the write path

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • Fully Compatible
    • Sharding EMEA 2021-12-27

      write_stage_common::skipWriteToOrphanDocument constructs a new ShardKeyPattern object from the shard key pattern BSON obj it gets from the collection metadata. This construction of a ShardKeyPattern object could be avoided by exposing the collection metadata's ShardKeyPattern object itself. This small optimization can be meaningful in the hot write path.

      The same pattern can be optimized in update_stage and upsert_stage

            Assignee:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Reporter:
            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: