Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-11634

Provide optimized versions of set_key/value for MongoDB index use cases

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: APIs
    • Storage Engines
    • 8
    • Nick - 2024-04-30, Megabat - 2024-05-14

      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.

            Assignee:
            ravi.giri@mongodb.com Ravi Giri
            Reporter:
            keith.smith@mongodb.com Keith Smith
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: