[SERVER-83348] Extend bounded sort optimization for timeseries for equality predicates on multi key indexes Created: 16/Nov/23  Updated: 02/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: qi-timeseries
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-66177 Optimize time-series sorting on multi... Closed
Assigned Teams:
Query Integration
Participants:

 Description   

In this line we restrict the bounded sort optimization for time-series on all indexes that are multikey. However this is too restrictive. Based on this comment, we should be able to extend this optimization on equality predicates on an index, even if it's multikey. This improvement will extend the optimization to queries like this:

// Secondary index for the time-series collection:
{ "meta.array": 1, t: -1 }
 
// Run a find query:
coll.find({ "meta.array": "value" }).sort({ t: -1 })
 
// This should result in an IXSCAN with $_internalBoundedSort


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