timescaledb

Add compression policy to timescaledb on continuous aggregate with integer time


I have a continuous aggregate on a hypertable that has an integer based time. The integer value is not an epoch() but it is a monotonically increasing integer, producing a new value approximately every 15 secs. There are functions that can convert this integer to a timestampz and vice vera.

My question is on how I can add a compression policy to compress everything older than a year.

The examples on the documentation suggest an interval but this I cannot use.

I am using timescaledb 2.15.3


Solution

  • I never tried it, but it seems if the set_integer_now_func will help to allow you to use the integer:

    https://github.com/timescale/timescaledb/blob/d1d74dcc92892c72fe93ddab7002026d2aaecdd7/tsl/src/bgw_policy/compression_api.c#L120