Extensive growth of HA database, maybe messed up config with 3 DBs?

Hello,

I have a problem with my HA database growing pretty significant since some month. After trying to figure out what might be the reason I’m even more confused than before and think my configuration might be messed up. Because I hope that my history data is still there, I wanted to ask for help before deleting anything.

The database started to grow mid january, as you can see in this graph. You can also see that there is no data before 19. November, so there is only 4 month of data.

I set up my HA over a year ago with MariaDB as internal database and InfluxDB for the history data. The database part of the configuration.yaml looks like this:

# Loads default set of integrations. Do not remove.
default_config:

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
sensor: !include_dir_merge_list sensors/
template: !include_dir_merge_list templates/

# Use MariaDB as internal database
recorder:
  db_url: !secret mariadb_url
  purge_keep_days: 120
  commit_interval: 60

# Use InfluxDB as history database
influxdb:
  host: !secret influxdb_ip
  port: !secret influxdb_port
  database: !secret influxdb_database
  username: !secret influxdb_user
  password: !secret influxdb_pass
  max_retries: 3
  default_measurement: state
  include:
    entity_globs:
      - sensor.aussen_*
      - sensor.... # some more sensors
    entities:
      - sensor.mariadb_database_size
      - sensor.influxdb_database_size
      - sensor.heatpump_power_filter
      - sensor.... # some more sensors

On thing I noticed and messed up is that the recorder has no include/exclude, but at least a purge every 4 months. What would happen if I now add some includes like in the influxdb section. Will all the other, not included data be deleted at the next purge?

Do I need the includes in the influxdb-section when I already have those in the recorder-section?

In Settings > System > Repair and then on the …-menu it lists mysql as database-engine for the recorder. So I’m not sure if any HA update might have messed um the MariaDB config and I’m now having 3 databases in parallel?!

Is there any other way to track down what is causing my database to grow that much and any way to reduce it again?

I didn’t read all that, but 1, why did you move away from the default that is optimized to work with HA already if you are not quite sure what is going on now?
Two, 20mb database is tiny. You should worry when it gets up over a couple of gigabytes…

Stop complicating your life. Migrate back to mySql default for the main database, delete what you have there now, and start over. You have the influx, save that as is for long term stats.

I’m not sure anymore. But when I set up the HA server back in 2023 I guess this was recommended?!

I don’t know where you got that number, but my databases are much bigger. 6 GB of MariaDB (Recorder) and 10 GB of InfluxDB (History). Interestingly InfluxDB has been 15 GB this morning but somehow got down to “only” 10 GB, which is the same size as in November 2025 before the increase in size started. Still, MariaDB was only half of the current size back then.

EDIT: Nevermind, the InfluxDB just went back up to 16 GB

It was.

The chart.

Well the influx number doesn’t have to be speedy like the main DB, so it can be bigger.
My personal rec on the maria DB stands.

Oh I think you missinterpreted that Y-scale wrong. I’m from germany, so the . (point) is NOT the decimal separator. We use the , (comma) as decimal separator. So 20.000 MB is 20 GB.

2 Likes