Home Assistant Add-on: PostgreSQL + TimescaleDB

What about renaming, setting up a new ltss table and inserting the old values?

Hi @Expaso, for some reason, which I do not know, the ltss table get‘s filled for three days now and the error is gone.

Thank you very much for your help!

1 Like

Perhaps auto vacuum has done it’s job and fixed the issues at hand. Great to hear it’s now working for you!

Runnig this database for a month,
with 1500 entities 30 days of data, addon takes about 12GB (checked with du -s /mnt/data/supervisor/addons/data/77b2833f_timescaledb)

SQLite and MariaDB took about 4GB for 30 days

InfluxDB takes about 10GB for several years of data

EDIT: just did maintanance > full vacuum on every table, database shrinked to 6GB

Well, if you are using LTSS, and are ingressing all data, it could grow very quickly…

To get things clear: You can use this addon purely as a postgresql backend to the normal home assistant recorder. In this case, it should indeed clean up (or stop growing) because the HA recorder component should clean-up it’s expired data.

If you are using LTSS (perhaps together with the recorder), you are storing both recorder data (which will clean itself) and also LTSS data (which will NOT clean itself).

LTSS is meant for Long-Term-State-Storage. How long? Thats up to you.
With LTSS you are responsible for purging old data.

There are various ways to do this:

  1. Schedule a SQL job in pgAgent to remove any data order than X.
  2. Compress data older than X ( Timescale Documentation | Compression)
  3. Downsample your data using Continues Aggregates ( Timescale Documentation | Continuous aggregates)

Or any combination of those.

Please read the above timescale documentation. It will give you valuable insights in all options. Personally, I never deleted any data, and I am running it for 5 years, purely on compression only (and use continues aggregates for query speedup).

I also have the InfluxDb addon next to it (doing … nothing, just for comparison), but Timescales uses less disk space than Influx in my setup.

1 Like