After the recorder purge keep days setting (10 days by default) the 5 minute LTS data is discarded. Only the hourly max, min and average LTS data are kept forever.
“Normal” history is kept within “purge interval” (10 days by default, may be changed).
Statistical data which is re-calculated every 5 minutes - is also kept within “purge interval” (let’s call it “short term LTS”).
Statistical data which is re-calculated hourly - kept forever (so called LTS).
History page shows “augmented history” (“normal” history + LTS for periods beyond “purge interval”) - for sensors with LTS stored, and shows only “normal” history for other entities (which are not excluded from Recorder).
History in more-info shows either “short-term LTS” (for sensors with LTS), “normal” history (for other entities) or nothing (for entities which are excluded from Recorder).
Some custom cards may show LTS (or “short-term LTS”).
If you need a “normal” history for some entity or “short-term LTS” (5-minutes) for a period longer than 10 days - you need to change “purge_interval”.
If I wanted to keep 1 or 5 minute data for a whole bunch of sensors for several months, what would be the smartest way to acheive this?
I assume that the purge interval defaults to 10 days because storing and manipulating huge amounts of data is resource-intensive, and therefore changing the purge interval to 360 days (for example) is not advised.
Not sure about any advantages of MariaDB nowadays.
Start with defining rules for Recorder for what entities should be stored.
Then start increasing “purge interval” to 1 month, then more…
Some people set “purge_interval” for 1 year & then complain like “DB is damaged etc”.
Probably if you keep only really needed data in DB - it will be more stable, no idea, I am not a DB expert.
(my humble experience: DB 1.3GB, 30 days, ~3K entities, some of them are not stored in DB)
Also, some people store important entities in InfluxDB for a longer period.