---
title: "The Home Assistant database is filling up: how to keep it from getting slow and huge"
description: "The Home Assistant Recorder records a history of every change and the database grows. We show how to see what takes up space, how to switch off the unneeded and how to purge safely."
canonical: "https://realhomeautomations.com/en/projects/home-assistant-database-keep-it-fast/"
language: en-US
updated: 2026-11-25T15:20:26+00:00
---

# The Home Assistant database is filling up: how to keep it from getting slow and huge

The Home Assistant Recorder records a history of every change and the database grows. We show how to see what takes up space, how to switch off the unneeded and how to purge safely.

> Canonical HTML page: https://realhomeautomations.com/en/projects/home-assistant-database-keep-it-fast/

- **Difficulty:** Intermediate
- **Build time:** 30–60 minutes
- **Reading time:** 3 minutes

## Tools required

- Home Assistant (with access to Settings → System)
- A backup (before every purge)
- A configuration editor (for the recorder block in configuration.yaml)


## What readers will learn

- Understand what the Recorder records and how long it keeps it
- Find the entities that fill the database
- Limit the recording of unneeded entities
- Purge the history safely


## Skill requirements

- Edit configuration.yaml
- Make and restore a backup

Home Assistant records every change of every entity. With thousands of entities and power sensors that update every few seconds, the database grows for days. In the end the history loads slowly, the backups are huge and the disk fills up. Here is how to prevent it.

 ## What you will learn

 What the component **Recorder**does, how to see which entities fill the database and how to record only what you need for history and charts.

 ## What you will need

- A working Home Assistant with access to **Settings → System** and a configuration editor.
- A fresh backup. You change the configuration and run a purge. The backup is a safety net.
- 30–60 minutes. The result shows after days, because the database does not shrink immediately.

 ## How it works

 The Recorder keeps the history in a database. By default this is a SQLite file. The history is purged automatically after a set number of days (`purge_keep_days`). The documentation states 10 days by default.

 Separately, Home Assistant keeps **long-term statistics** (for the energy panel and charts) for entities of a suitable type. They are not purged by `purge_keep_days`, so switching an entity off early from the Recorder may also deprive it of statistics. Check before you switch it off.

 At Simeon's the database is a 2.3 GB SQLite file with 90 days of history; voltage, current and power are kept for 10 days, and the long-term statistics are kept. His second installation, on a Home Assistant Green, has a 171 MB database with the default 10 days of history.

 ## Steps

- **Settings → System → Storage** shows how much space is used. If there is no visible problem, do not touch anything.
- Find the noisy entities: these are the ones that change most often, for example powers reported every few seconds. Their history in the entity's chart shows how dense the points are.
- Decide what you do not need in the history: for example fast-changing powers or diagnostic sensors.
- In `configuration.yaml` add a block `recorder`. Example (the values are examples):

 ```
recorder:
  purge_keep_days: 7
  exclude:
    domains:
      - automation
      - update
    entity_globs:
      - sensor.*_linkquality
      - sensor.*_rssi
```

- **Developer tools → YAML → Check configuration**, then restart Home Assistant.
- To purge immediately: **Developer tools → Actions → `recorder.purge`** using `keep_days` of your choice. Turning on `repack` shrinks the file, but makes the database unavailable while it runs, so do it at a quiet hour.

 ## Checking the result

- Watch the database size for a few days. After the restart the growth should be slower.
- Open the history of an entity you switched off. No new records appear.
- Check whether the charts you use (energy) still work.

 ## If it does not work

- The database does not shrink → `repack` has not been run → run it at a quiet hour or use `purge` using `repack`.
- Missing history for a needed entity → it ended up in `exclude` → remove the line and restart.
- Home Assistant does not start after a change → an error in the YAML → restore the backup or fix the indentation.

 ## Limitations

- A switched-off entity stays in Home Assistant and works in automations, it just does not keep history.
- Fewer days of history means less looking back in time in the charts.
- For a large installation an external database such as MariaDB is a separate topic. We do not recommend it as a start.

 ## Sources and verification status

 Checked against the documentation on 22.11.2026.

- [Home Assistant: Recorder](https://www.home-assistant.io/integrations/recorder/)
- [Home Assistant: Backups](https://www.home-assistant.io/common-tasks/os/#backups)