[SERVER-55942] Avoid sorting metadata object in BucketCatalog::insert by storing multiple entries in _openBuckets Created: 08/Apr/21  Updated: 29/Oct/23  Resolved: 27/Apr/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.0.0-rc0

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

Issue Links:
Related
related to SERVER-56157 Store MinMax data in flat data struct... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-04-19, Execution Team 2021-05-03
Participants:

 Description   

Sorting the metadata in BucketCatalog::insert can be an quite expensive operation. This is done so we can perform binary comparison to lookup bucket independently of user provided field order.

As an alternative approach that may perform better is to store multiple entries in the _openBuckets hash map that point to the same bucket to handle different sort orders. We can lazily normalize and retry the lookup if the first lookup failed.



 Comments   
Comment by Githook User [ 27/Apr/21 ]

Author:

{'name': 'Henrik Edin', 'email': 'henrik.edin@mongodb.com', 'username': 'henrikedin'}

Message: SERVER-55942 Store un-normalized bucket keys in the open buckets map.

Lazily normalize key on insert when un-normalized is not found.
Also use precomputed bucket hashes when modifying the bucket catalog under exclusive lock.
Branch: master
https://github.com/mongodb/mongo/commit/846e0a2acf38a7c1e53b25680a4982b575bfc919

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