[SERVER-85044] Propose progressive sort on time-series using $lookup Created: 29/Jun/21  Updated: 12/Jan/24  Resolved: 21/Jul/21

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

Type: Task Priority: Major - P3
Reporter: David Percy Assignee: David Percy
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Query Optimization 2021-07-12, Query Optimization 2021-07-26
Participants:

 Description   

$geoNear progressively scans larger and larger regions of the index.  This is like a subquery.  For time-series we want it to scan larger and larger sets of unpacked events.  Can we express this using $lookup?

Let's describe this approach in the design doc and get some feedback.



 Comments   
Comment by David Percy [ 08/Jul/21 ]

samuel.mercier I ended up adding a section for this: https://docs.google.com/document/d/1UjSC3yOOYnyvzLe1sMOTK6k7mRc_Zk8-WSH_S-tjSuk/edit#heading=h.78r49k1zacu7. Feel free to edit though!

Comment by David Percy [ 30/Jun/21 ]

This may be a problem:

Isn't the difference here whether the $maxDistance value is inclusive or exclusive? In the $near case it is not, and for $whithin it is.

This is how I understood things to work.

https://jira.mongodb.org/browse/SERVER-2342?focusedCommentId=22218&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-22218

Maybe we could add an option to $center to make it exclude the boundary.

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