[SERVER-61421] Refine plan cache key filter component to encode parameter markers Created: 11/Nov/21  Updated: 29/Oct/23  Resolved: 15/Mar/22

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

Type: Task Priority: Major - P3
Reporter: Anton Korshunov Assignee: Ruoxin Xu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-61422 Update SBE filter stage builder to us... Closed
Related
related to SERVER-64137 Remove featureFlagAutoParameterization Closed
is related to SERVER-62797 Invalidate SBE plan cache when any of... Closed
Backwards Compatibility: Fully Compatible
Sprint: QO 2022-02-07, QE 2022-02-21, QE 2022-03-07, QE 2022-03-21
Participants:

 Description   

Currently we encode an entire query filter BSON object into the plan cache key. In order to be able to map queries having a similar shape (as it's defined in SBE) we need to change the encoding scheme to take into account parameter markers, so that two queries

{a: 10}

and

{a: 20}

are mapped the same cached plan.



 Comments   
Comment by Githook User [ 15/Mar/22 ]

Author:

{'name': 'Ruoxin Xu', 'email': 'ruoxin.xu@mongodb.com', 'username': 'RuoxinXu'}

Message: SERVER-61421 Change SBE plan cache key encoding to reflect auto-parameterization
Branch: master
https://github.com/mongodb/mongo/commit/63a4f1e011860e34b8a29b6171e3cbdd58f15c8d

Comment by David Storch [ 14/Feb/22 ]

Contrary to what I originally said in my previous comment, the work to flush the SBE plan cache when query knobs are adjusted will actually be done underĀ SERVER-62797 rather than under this ticket.

Comment by David Storch [ 09/Feb/22 ]

A few notes based on a discussion of this ticket with anton.korshunov.

  1. This ticket should include the work to stop encoding the values of various query knobs into the cache key, and instead to flush the cache when the knob is reset.
  2. This ticket depends on SERVER-61422. By changing the definition of the cache key, we are essentially enabling auto-parameterization. This can't be done, even just for auto-parameterized collection scan plans, without SERVER-61422.
  3. There is an open discussion about whether it is possible to enable auto-parameterization in some scenarios but not others, in particular for collection scan plans but not index scan plans. We want to get some basic auto-parameterization scenarios working end to end, ideally without having to disable SBE plan cache scenarios that are already being tested in the "all feature flags" builders.
Generated at Thu Feb 08 05:52:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.