Help with ballooning database and logging data

I am running Hassio 0.76.2 on an Orange Pi Zero but my database has increased to 2.1GB! I run a few temperature sensors and switches. There are 48h histiry graphs and since putting more than one graph, they take forever to load.

How can I log the history of sensors and visualize the graphs fast even if this means exporting them to another service? How to optimize the database and limit what gets logged and for how long?

Thanks a lot!

Use the recorder exclude entity or domain so that you don’t record data you don’t need. Same goes for history and logbook (though that just excludes the entities from showing in these pages and has no effect on the db size).

You can also keep fewer days data.

I’m with @tom_l on this one.
My experience is, that not using the exclude option basically excludes everything and you have to use the include option to get recorded what you want to do log.
This is the most effective way to reduce dB-size.
If you use exclude for certain domains or entities you will still record a lot of stuff you don’t need, i.e. everything you did not exclude.