[SERVER-23271] Add metrics to track index key additions and deletions for all CRUD ops/commands Created: 21/Mar/16 Updated: 14/Mar/17 Resolved: 25/Apr/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Diagnostics, Querying |
| Affects Version/s: | 3.3.3 |
| Fix Version/s: | 3.3.5 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | James Wahlin | Assignee: | James Wahlin |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||
| Backwards Compatibility: | Major Change | ||||||||||||||||||||||||
| Sprint: | Query 13 (04/22/16), Query 14 (05/13/16) | ||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||
| Linked BF Score: | 0 | ||||||||||||||||||||||||
| Description |
|
Adding, updating and removing index entries can be an expensive part of any write operation, especially when a large # of index entries are involved. We should track this cost (at a minimum, a count of the # of changes performed) and record in both the profiler and in slow operation diagnostic logging. |
| Comments |
| Comment by Githook User [ 25/Apr/16 ] |
|
Author: {u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}Message: |
| Comment by Githook User [ 22/Apr/16 ] |
|
Author: {u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}Message: |
| Comment by Githook User [ 21/Apr/16 ] |
|
Author: {u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}Message: |
| Comment by Githook User [ 21/Apr/16 ] |
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: Revert " This reverts commit 6bbaee174447ee1c9177c72bdd07f050ab07e901. |
| Comment by Githook User [ 21/Apr/16 ] |
|
Author: {u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}Message: Revert " This reverts commit 2edcf2976ae45145af0c655d3e4a2dd9560b5b2f. |
| Comment by Githook User [ 21/Apr/16 ] |
|
Author: {u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}Message: |
| Comment by Githook User [ 21/Apr/16 ] |
|
Author: {u'username': u'jameswahlin', u'name': u'James Wahlin', u'email': u'james.wahlin@10gen.com'}Message: |
| Comment by James Wahlin [ 04/Apr/16 ] |
|
After further discussion we are now leaning towards adding both a 'keysInserted' and a 'keysDeleted' metric, rather than a single 'keysAffected' metric. The motivation for this is added clarity on work done. When an indexed value is changed in a document, this change is executed as a key removal + a key addition. With a single 'keysAffected' metric, an updated key value could be represented in one of 2 ways: Reporting 'keysInserted' and 'keysDeleted' helps clarify the actual work being performed and is easier to understand. We will have to educate users that an updated indexed value means 1 delete + 1 insert, but this seems easier to rationalize than the 'keysAffected' alternative. Note: The above is meant to reflect insert and delete operations on non-multikey indexes. On update of an indexed array field, the values of keysInserted and keysDeleted could be larger than 1, reflecting the true number of index keys inserted and removed to satisfy the operation. |
| Comment by James Wahlin [ 25/Mar/16 ] |
|
Our current plan is to add a "keysAffected" metric, that would be a sum of all index keys inserted, removed or updated during a given write operation. |