-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DB Optimizations #6712
DB Optimizations #6712
Conversation
✅ Deploy Preview for frigate-docs canceled.
|
Let's take a look at how homeassistant does this in core. |
https://www.home-assistant.io/integrations/recorder/
The purge seems to be when they actually remove the data from the DB The repack is just a call to |
Should we add a call to |
The changes are causing problems with the tests. I don't think there is an issue doing the indexes manually in SQL especially since this is how all previous indexes have been done as well. |
You have to be cautious about using the model objects for migrations because the model objects change over time. This can cause situations where historical migrations would be modified. For example:
Because you removed the field from the model definition, migration 002 is now broken. |
That's why in the changes I proposed, field names were strings, not objects |
It should work then. We ran into some issues when we tried to use the model objects to create new tables in the past. |
The tests were failing on the unique field inside of peewee migrator.py regardless of what I put |
Can I have more details? |
With what was suggested above this error occurs:
When I follow the peewee docs, this occurs:
|
Just remove the third option (unique=False) from add_index call. |
I tried that as well, and it also does not work
|
!=
which can not use indexes