Erik Nordström bc9726607e Use end of last bucket as cagg watermark
The function `cagg_watermark` returns the time threshold at which
materialized data ends and raw query data begins in a real-time
aggregation query (union view).

The watermark is simply the completed threshold of the continuous
aggregate materializer. However, since the completed threshold will no
longer exist with the new continuous aggregates, the watermark
function has been changed to return the end of the last bucket in the
materialized hypertable.

In most cases, the completed threshold is the same as the end of the
last materialized bucket. However, there are situations when it is
not; for example, when there is a filter in the view query some
buckets might not be materialized because no data matched the
filter. The completed threshold would move ahead regardless. For
instance, if there is only data from "device_2" in the raw hypertable
and the aggregate has a filter `device=1`, there will be no buckets
materialized although the completed threshold moves forward. Therefore
the new watermark function might sometimes return a lower watermark
than the old function. A similar situation explains the different
output in one of the union view tests.
2020-09-05 00:38:36 +02:00
..
2020-08-27 10:24:22 +02:00
2020-08-25 14:36:15 +02:00
2020-07-29 15:30:39 -04:00
2019-04-26 13:08:00 -04:00
2020-05-27 17:31:09 +02:00
2020-09-01 14:49:30 +02:00