[SERVER-78297] [CQF] Introduce and enforce RemoveOrphans physical property Created: 21/Jun/23  Updated: 29/Oct/23  Resolved: 07/Jul/23

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

Type: Task Priority: Major - P3
Reporter: Ben Shteinfeld Assignee: Ben Shteinfeld
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: QO 2023-06-26, QO 2023-07-10
Participants:

 Description   

Add a new physical property to cascades which represents the need to perform shard filtering (remove orphaned documents/values from a stream). Write an enforcer for this property. Implementers for this property will be taken on incrementally in follow-up tickets.



 Comments   
Comment by Githook User [ 07/Jul/23 ]

Author:

{'name': 'Ben Shteinfeld', 'email': 'ben.shteinfeld@mongodb.com', 'username': 'bshteinfeld'}

Message: SERVER-78297 Introduce and enforce `RemoveOrphansRequirement`

This patch implements barebones support for Bonsai to start generating physical plans that perform shard filtering.

  • Add bit to optimizer metadata to indicate whether a `ScanDefinition` can have orphans.
  • Introduce new physical property, `RemoveOrphansRequirement`, which indicates whether a group needs to perform shard filtering.
  • Write an enforcer rewrite which satisfies `RemoveOrphansRequirement` by inserting an `EvaluationNode` for each field of the shard key from the scan projection and inserting a `FilterNode` that uses those projections to invoke the `shardFilter` SBE builtin.

This patch only ever satisfies `RemoveOrphansRequirement` with a fetch. We will support shard filtering over index keys (enabling covered plans) in a followup.
Branch: master
https://github.com/mongodb/mongo/commit/812fc17a43496511c230f14a5d3618d8aa434d09

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