[SERVER-59331] Add memory tracking for compile-time size of SBE plan Created: 12/Aug/21  Updated: 29/Oct/23  Resolved: 17/Sep/21

Status: Closed
Project: Core Server
Component/s: Query Planning
Affects Version/s: 5.1.0
Fix Version/s: 5.1.0-rc0

Type: Task Priority: Major - P3
Reporter: David Storch Assignee: Alexander Ignatyev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: QE 2021-08-23, QE 2021-09-06, QO 2021-09-20
Participants:
Linked BF Score: 165

 Description   

*strong text*The new SBE plan cache will be bounded by a number of bytes rather than a number of cache entries, using an LRU replacement policy. As preparatory work to support this behavior, we need to be able to estimate the size of an SBE tree. The goal of this ticket is to add such a capability, so that it can be used for the SBE plan cache later.

We wish to calculate the "compile-time size", meaning the size of the SBE tree before it has been prepared or executed. This is because SBE trees will be stored in the plan cache in an unprepared, unexecuted state. The size should incorporate all of the sbe::PlanStage objects, as well as any expression trees they own, or any other resources owned by the sbe::PlanStage.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 17/Sep/21 ]

Author:

{'name': 'Alexander Ignatyev', 'email': 'alexander.ignatyev@mongodb.com', 'username': 'aligusnet'}

Message: SERVER-59331 Fix SBE size_estimator build on macOS
Branch: master
https://github.com/mongodb/mongo/commit/12f248b8498e0fcea14322894aad1ebb505beab5

Comment by Githook User [ 17/Sep/21 ]

Author:

{'name': 'Alexander Ignatyev', 'email': 'alexander.ignatyev@mongodb.com', 'username': 'aligusnet'}

Message: SERVER-59331 Add PlanCache's and EExpression's getCompileTimeSize() functions to calculate compile-time size of SBE Plan
Branch: master
https://github.com/mongodb/mongo/commit/2a82df1a0433d21bfb55ca7e6ff2b0d47822d34c

Generated at Thu Feb 08 05:46:58 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.