[SERVER-83492] Remove limit and skip values from SBE plan cache key if possible Created: 21/Nov/23  Updated: 12/Jan/24  Resolved: 18/Dec/23

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

Type: Improvement Priority: Major - P3
Reporter: Ivan Fefer Assignee: Ivan Fefer
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
Related
related to SERVER-84278 Don't generate plan cache entries for... Closed
related to SERVER-84436 Handle skip + limit sum overflowing i... Closed
related to SERVER-83959 When preparing SBE plan, correctly pa... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.2, v7.0
Sprint: QE 2023-11-27, QE 2023-12-11, QE 2023-12-25
Participants:
Case:
Linked BF Score: 135

 Description   

We encode exact limit and skip values as part of cache key in SBE:
encodeSBE calls encodeFindCommandRequest] that encodes skip and limit values.

While encodeClassic doesn't do it.

This may cause plan cache bloat and excessive multi planning in SBE.



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

Author:

{'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}

Message: SERVER-83492 Remove limit and skip values from SBE plan cache key (#17970)

GitOrigin-RevId: 557c0af4c179164e4809b46ea68550596d14a3e0
Branch: v7.0
https://github.com/mongodb/mongo/commit/9af5d0ec8d456e8d9770ace95e2799758e1cdffb

Comment by Githook User [ 03/Jan/24 ]

Author:

{'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}

Message: SERVER-83492 Remove limit and skip values from SBE plan cache key if possible
Branch: v7.2
https://github.com/mongodb/mongo/commit/08e0afda8c43dbd9d1160dcd83252363940ffa1e

Comment by Githook User [ 14/Dec/23 ]

Author:

{'name': 'Ivan Fefer', 'email': 'ivan.fefer@mongodb.com', 'username': 'Fefer-Ivan'}

Message: SERVER-83492 Extract limit and skip amounts to input params

GitOrigin-RevId: f7c5485517b5a459fc91af7b92b789426c625f30
Branch: master
https://github.com/mongodb/mongo/commit/ff406b02028cbe27b9a9a926e993f2fe2d825ea1

Comment by Ivan Fefer [ 21/Nov/23 ]

We can't just remove them, as limit and skip values are "hard coded" in SBE plan.
We have to move them to slots and make this slots input parameters instead.

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