-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: APIs
-
Storage Engines
-
8
-
Nick - 2024-04-30, Megabat - 2024-05-14, 2024-05-28 - FOLLOW ON SPRINT, 2024-06-11 - Dinosaurs go rawr
WiredTiger allows a rich variety of key and value formats. The resulting implementation of the cursor get_key, get_value, set_key, and set_value methods use varargs to parse/unpack the components of the key/value.
MongoDB uses a much smaller set of options. Providing a specialized interface for these scenarios would avoid the overhead of varargs.
MongoDB record stores use key_format=q,value_format=u. I.e., a 64-bit integer key and a WT_ITEM value.
MongoDB indexes use WT_ITEM for both the key and value.
WT-9786 provided an optimized raw cursor interface for getting the key and value when they are both WT_ITEM (i.e., the MongoDB index case).
This ticket is to consider whether we should support similar optimized cursor options for the other MongoDB scenarios, and if so implement them:
- set_key/set_value for raw cursors – the index use case when the key and value are both {{WT_ITEM}}s.
- get_key/get_value for record stores.
- set_key/set_value for record stores.
The trade-off here is cluttering up the API in exchange for unquantified performance gains. The record store case may be less interesting to optimize as the overhead has to be compared to the work the server does preparing/processing the document stored in the value.
- is related to
-
SERVER-90611 Use wiredtiger_struct_pack and raw mode for WT key setting
- Backlog
-
WT-9786 API improvements for get_key and get_value
- Closed
- related to
-
WT-12828 Provide optimized versions of get/set_key/value for MongoDB record store use cases
- Open