I have a TimescaleDB database running on Docker (which is running on Ubuntu). As you can guess, I store a lot of time-series data in it and to save disk space I activated a compression policy:
ALTER TABLE measurements SET (
timescaledb.compress,
timescaledb.compress_orderby = 'time DESC',
timescaledb.compress_segmentby = 'device'
)
SELECT add_compression_policy('measurements', INTERVAL '2 weeks')
and if I check the compression stats i get the result I expect:
- before compression --> 81GB
- after compression --> 3900MB
Until here it's all fine, except it does not free up actual disk space and the Docker folder that contains the TimescaleDB files is growing as if compression was never activated in the first place.
VACUUMing the whole DB has no effect, except for taking up an additional 1GB of disk space.
EDIT:
by disk space I mean the specific fs directory where the timescaleDB volume is mounted, where the database files are stored on the host machine.