[SERVER-29241] WiredTigerRecordStore::updateRecord has an unnecessary WT_CURSOR.set_key Created: 16/May/17 Updated: 30/Oct/23 Resolved: 21/Jul/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 3.5.11 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Keith Bostic (Inactive) | Assignee: | Keith Bostic (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Sprint: | Storage 2017-05-29, Storage 2017-06-19, Storage 2017-07-10, Storage 2017-07-31 |
| Participants: |
| Description |
|
WiredTigerRecordStore::updateRecord has an unnecessary WT_CURSOR.set_key. The key doesn't need to be re-set after the search, and, in fact, setting it here may slow down the subsequent WT_CURSOR.insert operation. The (untested) change I'm suggesting:
|
| Comments |
| Comment by Githook User [ 21/Jul/17 ] | ||||||||||
|
Author: {u'username': u'keithbostic', u'name': u'Keith Bostic', u'email': u'keith.bostic@mongodb.com'}Message: | ||||||||||
| Comment by Keith Bostic (Inactive) [ 18/Jul/17 ] | ||||||||||
|
The cursor insert/remove pair can't be changed, storage layer cursors are configured with overwrite=false. | ||||||||||
| Comment by Keith Bostic (Inactive) [ 17/May/17 ] | ||||||||||
|
There are similar patterns in WiredTigerIndexUnique::_unindex and WiredTigerIndexStandard::_unindex:
If that's called often enough to be interesting, the second set_key is unnecessary, plus the code path could be optimized by doing a cursor update/remove pair, which would be faster because it avoids a search. |