A quick little tip to get the size of your database into Home Assistant.
The example below will get the Home Assistant database size from MySQL. This should also work for MariaDB using the Recorder integration.
Assuming the database schema is called homeassistant, the select query:
SELECT table_schema "homeassistant", Round(Sum(data_length + index_length) / POWER(1024,2), 1) "value" FROM information_schema.tables WHERE table_schema="homeassistant" GROUP BY table_schema;