Reuse ShardKeyPattern object from collection metadata in the write path

XMLWordPrintableJSON

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

      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
              Reporter:
              Jordi Serra Torrens
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: