[SERVER-79692] Duplicated predicates pushed down into collection access for $match over time-series Created: 03/Aug/23  Updated: 30/Jan/24

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

Type: Bug Priority: Major - P3
Reporter: Irina Yatsenko (Inactive) Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 0
Labels: qi-timeseries, quick-tech-debt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-84113 Remove circular dependency between op... Needs Scheduling
Related
is related to SERVER-79585 A valid $match query fails on time-se... Closed
Assigned Teams:
Query Integration
Operating System: ALL
Steps To Reproduce:

Create a time-series collection with metaField called "meta".

db.ts.explain().aggregate([{$match: {$expr: {$lt: ["$meta",1]}}}, {$match: {$expr: {$gt: ["$meta", 1]}}}])
...
"parsedQuery" : {
        "$and" : [
                {"$expr" : {"$gt" : ["$meta", {"$const" : 1 }] }},
                {"meta" : {"$_internalExprGt" : 1 }},
                {"meta" : {"$_internalExprGt" : 1 }}
        ]
},

Participants:

 Description   

When multiple $match stages use expressions on the metaField we might create duplicated predicates on the bucketing collection


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