We’re experiencing an intermittent issue with aggregation queries on compressed data in TimescaleDB (versions 2.16 and 2.17). Specifically, when querying a single id_number from a compressed hypertable and selecting a time period for more than a week, we encounter an error. However, this error does not occur when the query includes multiple id_number values. We have two seemingly identical environments, but only one of them exhibits this behavior.
Error Message: ERROR: aggregated compressed column not found DETAIL: Assertion ‘value_column_description != NULL’ failed.
Environment Details:
Operating System: Ubuntu 22.04
PostgreSQL Version: 16.4
TimescaleDB Version: Tested on 2.16 and 2.17
Steps to Reproduce:
Set up compressed hypertable:
Create a hypertable (e.g., data_5min) with compression enabled.
Insert sample data and ensure the table has multiple chunks.
Run Query:
Single ID (FAILS)
SELECT
id_number AS idNumber,
AVG("value") AS "value",
time_bucket('6 hour', ts) AS timeBucket
FROM
data_5min
WHERE
id_number IN (10)
AND ts >= '2024-10-15 00:00:00'
AND ts < '2024-10-27 00:00:00'
GROUP BY
id_number, timeBucket
ORDER BY
timeBucket;
Multiple ID (WORKS)
SELECT
id_number AS idNumber,
AVG("value") AS "value",
time_bucket('6 hour', ts) AS timeBucket
FROM
data_5min
WHERE
id_number IN (10, 20)
AND ts >= '2024-10-15 00:00:00'
AND ts < '2024-10-27 00:00:00'
GROUP BY
id_number, timeBucket
ORDER BY
timeBucket;
Additional Information:
This error does not appear in an identical environment running TimescaleDB 2.16.
Verified that compression was enabled and checked chunk statuses.
Expected Behavior:
The query with a single id_number should execute without errors, as it does when querying with multiple IDs.
Right! the data_5_min is already your hypertable. I was confused that it was a continuous aggregation but it’s just a regular aggregation. It seems a bug in this case.
Let’s double check with @sven, with is working actively in several compression improvements.
Thanks @sven for replying. This seems to solve the problem, the query is successful with this change.
Is this something that you could update in the code or do i need to add this in postgresql.conf so that i don’t loose it when the timescaledb container is stopped/removed ?