[SERVER-50629] Deduplicate code which manages backing BSON objects for MatchExpressions Created: 28/Aug/20  Updated: 06/Dec/22

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

Type: Improvement Priority: Major - P3
Reporter: Nicholas Zolnierz Assignee: Backlog - Query Optimization
Resolution: Unresolved Votes: 0
Labels: PM-1749-stability
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Participants:

 Description   

As of SERVER-48790, MatchExpressions will no longer hold references to the original BSON. There are several pieces of code that have workarounds due to this:

  • The FLE analysis code which replaces the RHS of such expressions no longer needs to ensure that any BSONElements point to valid BSON.
  • RewriteExpr
  • Matcher class


 Comments   
Comment by David Storch [ 03/Sep/20 ]

Sounds good! And yeah, great point about Matcher. I agree that it could be deleted as part of this work.

Comment by Nicholas Zolnierz [ 03/Sep/20 ]

david.storch good call, I've updated the title and description to be less specific to FLE. I think we can get rid of the Matcher class too?

Comment by David Storch [ 31/Aug/20 ]

There's a similar simplification that I believe could be made to the RewriteExpr code, which holds BSON objects on behalf of MatchExpression leaf nodes here:

 https://github.com/mongodb/mongo/blob/f5da4e4b7f7f04267bd92736ee9b16417e6d70ff/src/mongo/db/matcher/rewrite_expr.h#L108

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