-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce LTSS database size #119
Comments
Currently, LTSS does not use TimescaleDB's compression feature (c.f. https://docs.timescale.com/use-timescale/latest/compression/about-compression/). There is #44 which enables compression but also splits out the attributes to a separate table. I just enable compression to my LTSS hypertable today, you should be able to do that without issue (backup first!): alter table "ltss" set (
timescaledb.compress,
timescaledb.compress_segmentby = 'entity_id'
);
select add_compression_policy('ltss', interval '7 days'); This will compress data after 7 days. Be careful as with compressed chunks you cannot delete anymore - more information in the TimescaleDB docs. For me, the size of the hypertable was reduced from ~4GB to 325MB. However, be sure that you are on the latest LTSS: #100 |
I played a bit today and found a way with which you can save some space. Currently the
The HA code still inserts into |
SELECT pg_size_pretty( hypertable_size('public.ltss')); I'd be very much interested in this feature as well. I've been running this Home Assistant + TimescaleDB + LTSS ever since 1st of January 2023 and my Initially I was thinking of reducing the commit interval for |
I am not an expert with LTSS and looking through the PRs and issues - it looks like there have been many attemps but I am wondering if there is any easy and practical solution to reduce the size of the LTSS database. My database is 17Gb and this doesn't feel very efficient. I did experiment in the past with other timeseries databases and out of the box the storage was more optimized.
Any recommendations to compact the size of the ltss table?
The text was updated successfully, but these errors were encountered: