Loading State History slow

Hi Team.
I have a particular sensor which changes state a LOT (its mqtt_room with a ble tag on my dogs collar, obviously they move around the house constantly all day)

Im running hass.io, on an atom pc via docker.
Those sensors take a LONG time to show the state history. I guess because theres a heap of data.
I am using mysql for my database, rather than sqllite, as i was already running it anyway.

As an example, running a count(*) from events for that particular entity_id shows ~50000 events. Thanks room assistant for spamming MQTT constantly :slight_smile:

Other sensors etc are fine, and the room sensors do eventually load, its just slow.
Can i just directly delete entries from the database that are older than a day or so to make it load quicker ? Is there anything else i need to be aware of ?
I havent actually delved into the database much, doing some historical tracking is an upcoming wet weekend project i want to tackle :slight_smile:

TIA!

1 Like

Iā€™d love to know a way to thin out some of my sensor/MQTT data too.