-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Query Optimization
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.