Better logs and history for Hass.IO setups PLEASE

Darned, it stopped working.
I am at
HA 0.104.3
Logbook cache: 3

I’ve tried accesing both directly and through nabu casa, no change :cry:

Stopped working, what does that mean?

It takes forever for it to open the logfile page, and then it shows ‘no log entries found’

I’ve created a new DB now, and now it loads again, hmmm, I wonder if it is the mariadb that corrups somehow.

That’s strange. If it happens again, debug logs will probably be useful.

Please create GitHub issues for any further problems, I cannot keep up with bug reports in various threads.

1 Like

Will do, thankyou for your great work!

1 Like

I agree.

The database is the Achilles hill of Home Assistant and needs a complete rewrite. HA currently treats the DB as a flat file dumping ground of JSON strings.

It needs to be rewritten to use the native DB types, relational record storage, proper indexes and stored procedures.

Wish I had the Python skills to do this.

1 Like

in fact using relational model for storing logs must not be as efficient as you think. denormalized form is usually more performant for such usecases.
Of course relational approach has a lot of pros and should be always considered as root one. But for some applications might create real bottleneck.

There are a lot of theories about loggin and optimizing storage, but one thing that is clear that doesn’t work, is using a relational database such as mysql as a heap database.
Either one thing or the other will work, but this will not.

@Frisbee You mean db without clustered index? Then in case of mysql it would be MyIsam engine. InnoDB supports clustered indexes. You can always convert myISAM tables to InnoDB on your own.

Question is if lack of clustered index is the only root cause of the issue.
There might be a lot of other reasons. I suppose most people don’t know (incl developers) that databases must be tuned up for particular use-cases and maintained after deployment. No db will work forever with default settings considering constant growth of number of records.

With the recent updates in the code to the db/logbook/history I consider this solved.

we can move .db to usb ?

https://www.cribbstechnologies.com/index.php/home-assistant/moving-home-assistant-logs/