[SERVER-84530] Add query stats key hash to output of $queryStats Created: 03/Jan/24  Updated: 26/Jan/24

Status: In Code Review
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Alyssa Clark
Resolution: Unresolved Votes: 0
Labels: flag-for-2885-backport, qi-query-stats
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Assigned Teams:
Query Integration
Operating System: ALL
Participants:

 Description   

Downstream analysis is finding it hard to identify a single entry, since we flatten out the 'key' object into its components, resulting in something like 50 fields to compare to determine if two entries are the same key (but at different points in time). Adding the hash value will make this easier.

 

Note: there is a question in my mind about whether this should be the SHA256 hash of the materialized 'key' BSON obj, or whether it should be the 'absl::hashOf(const query_stats::Key&)'. I think that it should probably be the former to better ensure that the same 'key' will compare the same across different hosts and possibly different versions of software (which may slightly differ in the absl implementation). This will make it more expensive to compute, so we should be sure to look at performance numbers.


Generated at Thu Feb 08 06:55:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.