States tables entity_id empty after upgrade + data size exploded

After I recently upgraded to 2023.10.0 the entity_id in the states table isn’t populated any more.

Also the number of entities has exploded for some reason. Not quite sure why - I see a lot of sensor entries, but unclear why. Postgres is taking a lot more CPU and I/O due to this.

What is the best way to start from scratch? Is there a defect in recorder?

Aaah, ok the schema has changed. Entity_id is now rolled up in a new table. Would have been nice to keep states intact and create a view that joins the normalized tables. I guess will create such view myself.

In the end created a fresh database and joined the tables (in a view) to make it look like the old states table. Especially read I/O was crazy high before. With the fresh new DB, it is back to normal.

image