[SERVER-83574] Rewrite single-field disjunctions to eqMember, consolidate eqMember Created: 27/Nov/23  Updated: 23/Jan/24  Resolved: 23/Jan/24

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

Type: Task Priority: Major - P3
Reporter: Timour Katchaounov Assignee: Backlog - Query Optimization
Resolution: Duplicate Votes: 0
Labels: M7
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-83456 Skip Filter->Sargable rewrite for col... Closed
Duplicate
duplicates SERVER-84351 [CQF] Missing $or simplification Backlog
is duplicated by SERVER-84351 [CQF] Missing $or simplification Backlog
Related
related to SERVER-85626 Complete TODO listed in SERVER-83574 Backlog
Assigned Teams:
Query Optimization
Participants:

 Description   

When skipping the Filter->Sargable transformation, the optimizer doesn't generate partial schema requirements, and consequently doesn't callĀ 
PartialSchemaReqLowerTransport which in turn would call consolidateEqDisjunctions(). As a result not all disjunctions are consolidated into a single eqMember. This task should:

  • Rewrite disjunctions of the form: {$or: [ {a: 1}

    , {a: 2}, {b: 3}]} into eqMember.

  • Consolidate eqMember on the same field into one eqMember.
  • Remove duplicate members.

The potential performance benefit of this rewrite should come from:

  • potentially removing duplicate disjunctions
  • reducing the size of the SBE plan, and using a single traverseF with a single isMember instead of multiple traverseF for each equality.

This rewrite could be done as part of a more general simplification.


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