[SERVER-77867] Investigate when to avoid pushing down FETCH for rooted or queries on clustered collections Created: 07/Jun/23  Updated: 03/Feb/24

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

Type: Improvement Priority: Major - P3
Reporter: Gil Alon Assignee: Backlog - Query Integration
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-77280 $or queries only produce collscan for... Closed
Assigned Teams:
Query Integration
Participants:

 Description   

SERVER-77280 made it possible for queries like 

coll.find( { $or: [{ _id: 8 }, { a: 5 }] } }) 

to produce a query plan that has both a clustered collection scan and index scan for clustered collections. However, we push down a FETCH stage for each index scan node. We should see if there are cases where we can avoid adding a FETCH stage unnecessarily. One idea is to avoid pushing a FETCH when we have count, like:

coll.find( { $or: [{ _id: 8 }, { a: 5 }] } }).count() 

 

 


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