Uploaded February 2026 | Updated September 2026, 3 weeks ago
Why is your Home Assistant Slow?
If your Home Assistant (HA) feels sluggish or you're seeing "Disk Use" warnings, the culprit is likely the Recorder integration. By default, HA keeps 10 days of every single state change and event. Over time, this home-assistant_v2.db file can grow to several gigabytes, slowing down your history graphs and backups.
Data Recorder - detail 10 days
Long-term Statistics - never delete until user clean up (LTS)
Change detail data recording.
Edit the recorder section below if you want to keep detailed data for 30 days:
YAML
recorder:
purge_keep_days: 30
Timeline video
00:00 Intro: The Database Bloat Problem
00:34 Method 1: Changing the Default Retention Period
01:41 Method 2: Manual Purge via Developer Tools (Repacking)
03:47 Method 3: Filtering "Noisy" Entities with Exclusions
05:35 Method 4: Deleting the Database for a Fresh Start
Method 1: Adjusting the Retention Period
The easiest way to keep your database small is to tell Home Assistant to stop hoarding data. By default, it keeps 10 days, but for many, 3 or 5 days is plenty.
service: recorder.purge
data:
keep_days: 1
repack: true
The Fix: Modify your configuration.yaml to include the purge_keep_days variable.
Pro-Tip: If you want long-term data for energy or temperature, use Long-Term Statistics (LTS) instead of keeping the raw recorder data.
Method 2: Manual & Individual Purge
Don't want to wait for the system to clean itself?
You can trigger a manual purge immediately via the Developer Tools.
The Service: recorder.purge
The Benefit: Use the "repack" option here to actually shrink the file size on your disk, not just delete the rows in the table.
Method 3: Automatic Purge & Entity Exclusions (The Best Way)
This is the "Set it and Forget it" method.
We use the Recorder Integration to ignore "noisy" entities that don't need history.
Exclusions: Stop logging things like sun.sun, time sensors, or high-frequency power monitors.
Example Config:
recorder:
purge_keep_days: 90
exclude:
domains:
- automation
- updater
entity_globs:
- sensor.weather_*
More complex
YAML Configuration: The "Lean & Mean" Setup
To stop the bloat before it starts, copy this into your configuration.yaml. This setup limits data retention and stops "chatty" sensors from filling up your storage.
YAML
Example configuration for a clean & fast database
recorder:
purge_keep_days: 7 # Automatically delete data older than 7 days
auto_purge: true # Runs the purge every night at 04:12 AM
# EXCLUDE: Tell HA, what NOT to record
exclude:
domains:
- automation # Do you really need to see when every automation ran?
- scene # Scenes don't usually need a history
- script
entity_globs:
- sensor.weather_* # Excludes all weather sensors
- sensor.uptime* # Excludes system uptime sensors
entities:
- sun.sun # The sun position changes every minute; skip it!
- sensor.processor_use # High-frequency data that eats space
What these settings do:
purge_keep_days: This is your "trash day" setting. Setting this to 7 means you’ll always have a week of history, but anything older is wiped to save space.
exclude: This is the most powerful tool for speed. By excluding Domains (like all automations) or Entities (like a power meter that updates every second), you reduce the "write" load on your SD card or SSD.
entity_globs: A shortcut to exclude group
Method 4: The "Fresh Start" (Delete & Refresh)
When the database is corrupted or simply too large to handle, sometimes it's best to start over.
The Process: Stop the Core, delete the .db file, and restart HA.
Warning: This will wipe your history graphs, but your entities and automations will remain untouched. It’s like a deep lung detox for your Raspberry Pi or NUC.
Why is your Home Assistant Slow?
If your Home Assistant (HA) feels sluggish or you're seeing "Disk Use" warnings, the culprit is likely the Recorder integration. By default, HA keeps 10 days of every single state change and event. Over time, this home-assistant_v2.db file can grow to several gigabytes, slowing down your history graphs and backups.
Data Recorder - detail 10 days
Long-term Statistics - never delete until user clean up (LTS)
Change detail data recording.
Edit the recorder section below if you want to keep detailed data for 30 days:
YAML
recorder:
purge_keep_days: 30
Timeline video
00:00 Intro: The Database Bloat Problem
00:34 Method 1: Changing the Default Retention Period
01:41 Method 2: Manual Purge via Developer Tools (Repacking)
03:47 Method 3: Filtering "Noisy" Entities with Exclusions
05:35 Method 4: Deleting the Database for a Fresh Start
Method 1: Adjusting the Retention Period
The easiest way to keep your database small is to tell Home Assistant to stop hoarding data. By default, it keeps 10 days, but for many, 3 or 5 days is plenty.
service: recorder.purge
data:
keep_days: 1
repack: true
The Fix: Modify your configuration.yaml to include the purge_keep_days variable.
Pro-Tip: If you want long-term data for energy or temperature, use Long-Term Statistics (LTS) instead of keeping the raw recorder data.
Method 2: Manual & Individual Purge
Don't want to wait for the system to clean itself?
You can trigger a manual purge immediately via the Developer Tools.
The Service: recorder.purge
The Benefit: Use the "repack" option here to actually shrink the file size on your disk, not just delete the rows in the table.
Method 3: Automatic Purge & Entity Exclusions (The Best Way)
This is the "Set it and Forget it" method.
We use the Recorder Integration to ignore "noisy" entities that don't need history.
Exclusions: Stop logging things like sun.sun, time sensors, or high-frequency power monitors.
Example Config:
recorder:
purge_keep_days: 90
exclude:
domains:
- automation
- updater
entity_globs:
- sensor.weather_*
More complex
YAML Configuration: The "Lean & Mean" Setup
To stop the bloat before it starts, copy this into your configuration.yaml. This setup limits data retention and stops "chatty" sensors from filling up your storage.
YAML
Example configuration for a clean & fast database
recorder:
purge_keep_days: 7 # Automatically delete data older than 7 days
auto_purge: true # Runs the purge every night at 04:12 AM
# EXCLUDE: Tell HA, what NOT to record
exclude:
domains:
- automation # Do you really need to see when every automation ran?
- scene # Scenes don't usually need a history
- script
entity_globs:
- sensor.weather_* # Excludes all weather sensors
- sensor.uptime* # Excludes system uptime sensors
entities:
- sun.sun # The sun position changes every minute; skip it!
- sensor.processor_use # High-frequency data that eats space
What these settings do:
purge_keep_days: This is your "trash day" setting. Setting this to 7 means you’ll always have a week of history, but anything older is wiped to save space.
exclude: This is the most powerful tool for speed. By excluding Domains (like all automations) or Entities (like a power meter that updates every second), you reduce the "write" load on your SD card or SSD.
entity_globs: A shortcut to exclude group
Method 4: The "Fresh Start" (Delete & Refresh)
When the database is corrupted or simply too large to handle, sometimes it's best to start over.
The Process: Stop the Core, delete the .db file, and restart HA.
Warning: This will wipe your history graphs, but your entities and automations will remain untouched. It’s like a deep lung detox for your Raspberry Pi or NUC.










