[SERVER-62149] Reuse ShardKeyPattern object from collection metadata in the write path Created: 17/Dec/21  Updated: 29/Oct/23  Resolved: 20/Dec/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.3.0

Type: Task Priority: Major - P3
Reporter: Jordi Serra Torrens Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-61767 Optimizing the new way of filtering w... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2021-12-27
Participants:

 Description   

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



 Comments   
Comment by Githook User [ 20/Dec/21 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-62149 Reuse ShardKeyPattern object from collection metadata in the write path
Branch: master
https://github.com/mongodb/mongo/commit/08bd8be2be413e37325173aa5138be22101878d6

Generated at Thu Feb 08 05:54:18 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.