7 Commits

Author SHA1 Message Date
Zoltan Haindrich
9d3866a50e Accept all compression options on caggs
Enable to properly handle 'compress_segmentby' and 'compress_orderby'
compression options on continous aggregates.

ALTER MATERIALIZED VIEW test_table_cagg SET (
  timescaledb.compress = true,
  timescaledb.compress_segmentby = 'device_id'
);

Fixes #5161
2023-02-13 22:21:18 +01:00
Fabrízio de Royes Mello
a4356f342f Remove trailing whitespaces from test code 2022-11-18 16:31:47 -03:00
Fabrízio de Royes Mello
3749953e97 Hierarchical Continuous Aggregates
Enable users create Hierarchical Continuous Aggregates (aka Continuous
Aggregates on top of another Continuous Aggregates).

With this PR users can create levels of aggregation granularity in
Continuous Aggregates making the refresh process even faster.

A problem with this feature can be in upper levels we can end up with
the "average of averages". But to get the "real average" we can rely on
"stats_aggs" TimescaleDB Toolkit function that calculate and store the
partials that can be finalized with other toolkit functions like
"average" and "sum".

Closes #1400
2022-11-18 14:34:18 -03:00
Bharathy
d218715d5c Fix tests which fail on PG15
When TimescaleDB 2.9.0 compiled against PG15, many tests fail due to
permissions on default public schema not getting propagated to data
nodes, although connected user has required GRANTS on access nodes.
This patch fixes failing tests by explicitly granting required permissions
for connected user or role after data nodes are added.
2022-10-19 17:57:54 +05:30
Sven Klemm
424f6f7648 Remove database port from test output
Don't include the used database ports into test output as this
will lead to failing tests when running against a local instance
or against a preconfigured cloud instance.
2022-09-15 07:56:12 +02:00
Fabrízio de Royes Mello
1e8d37b54e Remove chunk_id from materialization hypertable
First step to remove the re-aggregation for Continuous Aggregates
is to remove the `chunk_id` from the materialization hypertable.

Also added new metadata column named `finalized` to `continuous_cagg`
catalog table in order to store information about the new following
finalized version of Continuous Aggregates that will not need the
partials anymore. This flag is important to maintain backward
compatibility with previous Continuous Aggregate implementation that
requires the `chunk_id` to refresh data properly.
2022-05-06 14:30:00 -03:00
Aleksander Alekseev
eedaaecc46 Custom origin's support in CAGGs
This patch allows using custom origin's in CAGGs, for instance:

time_bucket_ng('7 days', day, '2000-01-03' :: date) AS bucket

For weekly buckets this allows the user to choose what should be considered
the beginning of the week - Sunday or Monday. Also by shifting the origin
one second forward or backward user can tweak the inclusiveness of the
buckets.

This works for date's, timestamp's and timestamptz's. The bucket size is
considered variable-sized in all these cases. CAGGs on top of distributed
hypertables, compressed hypertables and compressed distributed hypertables
are supported as well.

Additionally, this patch does several small refactorings. Firstly, it makes
sure that experimental features of CAGGs will be tested in both Debug and
Release builds. This was previously overlooked. Secondly, it renames the tests
so that a person who is working on experimental features in CAGGs will be able
to easily execute all the related tests: `TESTS='exp_cagg_*' make installcheck`

Last but not least the patch refactors is_valid_bucketing_function() and
renames it to function_allowed_in_cagg_definition(). The reason to do it in
this patch is that otherwise, the logic of the function gets rather confusing
which complicates code review.

fix
2022-02-18 17:35:24 +03:00