Skip to content

x Optimize Your Home Assistant Database

KimJacobsen edited this page Mar 8, 2024 · 3 revisions

As always start with making a backup

Purge and repack the database of MariaDB

The last call-service will purge the entire database and issue a repack command.

Please note that this is a heavy command, which will rebuild the entire database, optimize or recreate the events and states tables.

Use this only if you have slowdown issues.

From /developer-tools/service

service: recorder.purge
data:
  keep_days: 36
  repack: true

This made my DB go from 3100 MiB to 608 MiB.

Find more info about Optimize Your Home Assistant Database <--------