Since 2021.05 Database purge with repack seemingly never completes

I’m not sure I grasp the new features for the database, but:

When I purge the database (with repack), as usual the .db-wal and .db-shm files are created. However, they never change in size or disappear as was the case before.
Since the database by far uses the most space, my backup-files just doubled in size.

Is this expected behavior?

After executing “vacuum” on the database, the logs were flushed to the database, and everything is fine again.

Can you explain your fix?

I did not find a fix and I’m not sure wheather this problem still exists. I just stopped doing a purge with repack in my automatiin.
When you restart HA the extra files will disappear.

Ahh ok. Thanks. My database is growing too quickly and I am looking for ways to wrangle it. I have seen others suggest a repack but I can’t get it to work.

Repack only removes unused space from the database file. If there is no free space you will not see a difference.

If you want to reduce the size of your database you have to write less to it.
It’s mostly sensors that frequently change their states or state attributes like power, bandwidth, temperature, datetime, some device trackers, etc. that make up the biggest volume in the database.

Exclude those sensors from the database or filter them somehow with filter- or template-sensors so they don’t update that frequently.