Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

Continuous aggregates creation not supported by the normalized storage #44

Open
ivansenic opened this issue Dec 5, 2019 · 1 comment

Comments

@ivansenic
Copy link

I am not 100% sure that what I will write is completely true, but we are using the pg_prometheus with normalized storage for some time now. Today we wanted to create some basic continuous aggregates view so that our dashboards are more responsive when looking to the long-term data.

Unfortunately we constantly fail to do so. Even the most simply aggregate like:

prometheus=# CREATE VIEW basic
prometheus-# WITH (timescaledb.continuous)
prometheus-# AS
prometheus-# SELECT
prometheus-# time_bucket('1 day', time),
prometheus-# sum(value) AS "total"
prometheus-# FROM metrics
prometheus-# GROUP BY time_bucket('1 day', time);
ERROR:  invalid SELECT query for continuous aggregate

fails with the invalid select query error message. The select query itself works without any problem of course.

As I understand this, the creation most likely fails as the metric is not a table, but a view. If this is the case, how can we perform continuous aggregates with the normalized storage? Would I need to go directly to the metrics_labels and metrics_values tables?

Any suggestions would be great here.

@k-rus
Copy link

k-rus commented Dec 5, 2019

Continues aggregate expects single hypertable in the from clause. Views, joins, subqueries are not supported. See the docs

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants