[SERVER-43747] Avoid using KeyString::getKeySize() in WiredTigerIndex when possible Created: 01/Oct/19  Updated: 29/Oct/23  Resolved: 15/Oct/19

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Improvement Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Geert Bosch
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-10-21
Participants:

 Description   

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.


 Comments   
Comment by Githook User [ 11/Oct/19 ]

Author:

{'name': 'Geert Bosch', 'username': 'GeertBosch', 'email': 'geert.bosch@mongodb.com'}

Message: SERVER-43747 Skip getKeySize for non-unique indexes
Branch: master
https://github.com/mongodb/mongo/commit/1e702a5ca25a2e78756380d1ef22d8e12b94694c

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