Down sampling data

I am using timescaledb with telegraf. I have a database which is close to 200GB. I am trying to follow this documentation: How to proactively manage long-term data storage with downsampling to see how I can downsample my data so I can save space.

My policy would be simple. If the data is older than 1 month: downsample from 15s to 5 min. My question is, do I setup a cron job to do this? According to that doc, I don’t see how and where they schedule for the downsample.

hi @Rita_Morgan , the scheduling is done in the background workers system.
the blog example is outdated and just focusing on this info:

    timescaledb.ignore_invalidation_older_than='5d',

Today, it would be done through retention policies for the continuous aggregates:
Use add_retention_policy instead and setup the schedule_interval to be as your desired interval.

I hope it helps, and happy new year! :slight_smile:

Is it possible to do downsampling on a view? Or do I have to go for the underlying timescaledb slab?

view is just a snippet for the underlying query. you need to do it on the hypertable or continous aggregates .