[SERVER-44098] Pass only number of keys in shouldMarkIndexAsMultiKey Created: 18/Oct/19  Updated: 29/Oct/23  Resolved: 22/Oct/19

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

Type: Improvement Priority: Minor - P4
Reporter: Geert Bosch 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-11-04
Participants:

 Description   

In AbstractIndexAccessMethod::insert/update and a few other places, we call shouldMarkIndexAsMultikey passing a vector of keys. Because the caller only has a set, it needs to copy all keys into a vector. However, shouldMarkIndexAsMultikey really only needs to know the number of keys, so we should stop passing the vector and doing the conversion.

Fixing this adds 3.3% to validation speed, and should speed up index operations in general.



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

Author:

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

Message: SERVER-44098 Pass only number of keys in shouldMarkIndexAsMultiKey
Branch: master
https://github.com/mongodb/mongo/commit/48706d5d2779e16e4f4183bc0fd6343510cb17e0

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