The anomaly happens when the query plan contains a temporal filter followed by a MIN or ARG_MIN aggregate that uses the timestamp value as the ORDER BY column. The temporal filter compiles into a window operator, which continuously generates retractions for the records sliding out of the window. These retractions can take some time to merge with corresponding insertions. The subsequent MIN aggregate sets the cursor to the smallest value in each group, which is normally O(1); however in this case it mus still iterate over all zero-weight values. Even though the number of zeros may be small relative to the size of the integrals, all of them show up at the start of the group (since the group is sorted by the timestamp in this case), which makes this very expensive.
