Home Assistant reduces the work needed to show and maintain long statistics histories. The Energy year view builds its monthly results as readings arrive from the database, while imports and unit conversions update records in batches instead of handling each row separately.
In the contributor’s generated test database, the Energy year query fell from 350 to 180 milliseconds. Changing the unit of a ten-year history on SQLite fell from seventeen seconds to 1.1 seconds, reducing the time that operation occupies the recorder. These are local measurements; the resulting statistics matched the earlier output.