Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
None
-
Query Optimization
Description
The executors for $last/$first do not cache results, even if the window is static ([unbounded, unbounded]). This means that we will evaluate the same expression against the same document for every document in the window.
Without partitioning it's probably not an interesting case, but I could imagine a query such as "give me the last measurement per device" would be impacted by this.