6 Commits

Author SHA1 Message Date
Matvey Arye
08ad7b6612 Add ignore_invalidation_older_than to continuous aggs
We added a timescaledb.ignore_invalidation_older_than parameter for
continuous aggregatess. This parameter accept a time-interval (e.g. 1
month). if set, it limits the amount of time for which to process
invalidation. Thus, if
	timescaledb.ignore_invalidation_older_than = '1 month'
then any modifications for data older than 1 month from the current
timestamp at insert time will not cause updates to the continuous
aggregate. This limits the amount of work that a backfill can trigger.
This parameter must be >= 0. A value of 0 means that invalidations are
never processed.

When recording invalidations for the hypertable at insert time, we use
the maximum ignore_invalidation_older_than of any continuous agg attached
to the hypertable as a cutoff for whether to record the invalidation
at all. When materializing a particular continuous agg, we use that
aggs  ignore_invalidation_older_than cutoff. However we have to apply
that cutoff relative to the insert time not the materialization
time to make it easier for users to reason about. Therefore,
we record the insert time as part of the invalidation entry.
2019-12-04 15:47:03 -05:00
Matvey Arye
2f7d69f93b Make continuous agg relative to now()
Previously, refresh_lag in continuous aggs was calculated
relative to the maximum timestamp in the table. Change the
semantics so that it is relative to now(). This is more
intuitive.

Requires an integer_now function applied to hypertables
with integer-based time dimensions.
2019-11-21 14:17:37 -05:00
Sven Klemm
2cd4766ea1 Fix detecting JOINs for continuous aggs
When explicit JOIN syntax is used the from list will contain a
JoinExpr instead of a list of RangeTblRef which was not detected
properly by cagg_validate_query. This patch adds a check for
RangeTblRef to the validation code.
2019-05-10 18:56:33 +02:00
gayyappan
297b9ed66a Add default index for continuous aggregates
Add indexes for materialization table created by continuous aggregates.
This behavior can be turned on/off by using timescaledb.create_group_indexes parameter
of the WITH clause when the continuous agg is created.
2019-04-30 14:31:03 -04:00
Joshua Lockerman
652c6cec0f Add additional tests for Continuous Aggregates
Tests include:
1. UPDATEs get logged to the invalidation log.
2. the invalidation log is not written to on ABORT.
3. custom time-partitioning functions are not supported
   (also updates error message for this case).
2019-04-26 13:08:00 -04:00
Matvey Arye
eec90593fe Rename continuous aggs files for consistency
Rename continuous aggs files to be more consistent and follow our
conventions.
2019-04-26 13:08:00 -04:00