Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-43747

Avoid using KeyString::getKeySize() in WiredTigerIndex when possible

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.3.1
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • Labels:
      None
    • Fully Compatible
    • Execution Team 2019-10-21

      There are a few calls to KeyString::getKeySize() in WiredTigerIndex such as here to determine if the KeyString has a RecordId appended. We should avoid calling this method when possible because it reconstructs the entire KeyString which is an expensive operation.

      There are a couple known cases when we know whether the RecordId is appended to the KeyString or not.

      • _id indexes: these never have the RecordId appended.
      • Non-unique indexes: they always have the RecordId appended.

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: