[SERVER-56176] Updates and deletes reposition cursors once more than necessary Created: 19/Apr/21 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Louis Williams | Assignee: | Backlog - Query Execution |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Execution
|
| Sprint: | Execution Team 2021-05-31 |
| Participants: |
| Description |
|
Our UpdateStage and DeleteStage restore their cursors after committing each update or delete write. For single-document updates and deletes, however, this is unnecessary work and requires recreating and repositioning a cursor that will not be used further. A more optimal solution would be to lazily restore the cursors, if necessary, at the beginning of each doWork() function. This would ensure single updates/deletes do not do more work than necessary. |
| Comments |
| Comment by Louis Williams [ 19/May/21 ] |
|
I thought this would be a pretty harmless optimization, and while it did increase throughput in some workloads, it decreased throughput in others. I'm going to investigate a little bit more, but I might just end up closing this if I don't make any progress. |