[SERVER-81144] Compute QueryShapeHash from QueryShape without full serialization Created: 18/Sep/23  Updated: 06/Jan/24  Resolved: 06/Jan/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Task Priority: Major - P3
Reporter: Denis Grebennicov Assignee: Denis Grebennicov
Resolution: Fixed Votes: 0
Labels: M3
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-83217 Investigate QueryShapeHash alternativ... In Progress
is related to SERVER-79736 Hash C++ data structures directly rat... Closed
Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Sprint: QE 2023-12-25, QE 2024-01-08
Participants:

 Description   

Currently QueryShapeHash (256 bits) as is used by the Query Settings, can only be computed once QueryShape is fully serialized into BSON.

This ticket should investigate the implementation of QueryShapeHash computation without full serialization, but rather through computing the hash of individual shape components and then combining it into the QueryShapeHash value.

 

Futhermore, even if absl hash is used, we may avoid generating the QueryShape and go for QueryShapeHash directly, in order to gain additional performance



 Comments   
Comment by Githook User [ 06/Jan/24 ]

Author:

{'name': 'Denis Grebennicov', 'email': 'denis.grebennicov@mongodb.com', 'username': 'denis631'}

Message: SERVER-81144 Compute QueryShapeHash from QueryShape without full serialization (#17548)

Before this patch, in order to compute SHA256 hash of the query shape, a
full serialization into a BSONObj was necessary, which was later hashed
using SHA256 algorithm. This patch remove the full serialization into
BSONObj and instead relies on hash combining of individual query shape
components. This provides performance boost when computing the hash.

GitOrigin-RevId: 9f636e46a72e3fbf91046f23d199e23ea6acdb6f
Branch: master
https://github.com/mongodb/mongo/commit/2d2c9b1d2c767a03a1abe3c4b9aab9e0542ab225

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