[SERVER-65847] Construct simpler parameterized SBE index scan plans when possible Created: 20/Apr/22  Updated: 29/Oct/23  Resolved: 09/May/22

Status: Closed
Project: Core Server
Component/s: Query Planning
Affects Version/s: None
Fix Version/s: 6.0.0-rc5, 6.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: Denis Grebennicov
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-66274 Extend the cases of construction of s... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v6.0
Sprint: QE 2022-05-02, QE 2022-05-16
Participants:
Linked BF Score: 120

 Description   

When a query gets auto-parameterized and an index scan plan is built by the QueryPlanner, the SBE stage builder has to convert this into an SBE plan that will work for all possible values of the input parameters. This entails a fair amount of complexity and requires us to build a larger SBE plan. In particular, we currently always construct a plan with a branch stage. One of the branches uses the fully generic recursive index scan algorithm, and the other just scans a range of index intervals known up front.

For certain simple parameterized queries (e.g. if the bounds are based on a single equality predicate and will always be point bounds), we can avoid constructing this complicated branch plan and still be fully correct for all possible parameter values. This enhancement should show up as a performance improvement in some of our microbenchmarks.



 Comments   
Comment by Githook User [ 09/May/22 ]

Author:

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

Message: SERVER-65847 Construct simpler parameterized SBE index scan plans when possible
Branch: v6.0
https://github.com/mongodb/mongo/commit/8bdca7b05b91e53309d485c91f7d087a871fafa9

Comment by Githook User [ 06/May/22 ]

Author:

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

Message: SERVER-65847 Construct simpler parameterized SBE index scan plans when possible
Branch: master
https://github.com/mongodb/mongo/commit/f6048ece71786e490684a472c87c70b0b3089f40

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