Investigate apparent regression in classic engine IDHACK (SERVER-68110)

[SERVER-76041] Avoid SBE registering slots that aren't needed Created: 12/Apr/23  Updated: 10/May/23  Resolved: 20/Apr/23

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

Type: Sub-task Priority: Major - P3
Reporter: Colin Stolley Assignee: Colin Stolley
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-76126 Do not set value of $$USER_ROLES unle... Closed
Sprint: QE 2023-05-15
Participants:

 Description   

In https://github.com/10gen/mongo/blob/master/src/mongo/db/query/sbe_stage_builder.cpp#L128-L139  we end up registering slots for

$$USER_ROLES

$$NOW

$$SEARCH_META

regardless of whether the query uses these variables or not. These slots aren't free, so if we could skip some/all when they aren't used, we'd win some perf back.

Likewise setUserRoles() is called whether we use $$USER_ROLES or not, and that also is not free, and would be great to only run if needed.



 Comments   
Comment by Colin Stolley [ 20/Apr/23 ]

Closing as we can't know whether SEARCH_META will be set later on, so it's impossible to check for at SBE stage creation. Likewise, $$NOW appears to be used in contexts beyond what users might reference in their query, so that too must be kept. That only leaves $$USER_ROLES, which militsa.sotirova@mongodb.com has addressed already in SERVER-76126.

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