-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
index on sql data 8000 base to allow hass to startup quickly with a large sql database #8255
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
Conversation
@pvizeli Hi - I believe I've seen you deal with the issue of a stuck cla-bot before? If not, do you know how I can go about getting the bot working again? edit Looks like you tried - thanks! But it is still stuck :( |
@@ -64,6 +64,7 @@ def _apply_update(engine, new_version): | |||
# Create indexes for states | |||
_create_index(engine, "states", "ix_states_last_updated") | |||
_create_index(engine, "states", "ix_states_entity_id_created") | |||
_create_index(engine, "states", "ix_states_created_domain") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work. You need to create a new migration version. Otherwise people that already had this migration (=everyone) will not get it applied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@balloob thanks! Looking at it, is the correct way to acheive this:
- Update models.py#SCHEMA_VERSION to 3
- Change migration.py#_applyUpdates to include a new block
elif new_version == 3:
with my index migration
Anything else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Ah - looks like my email wasn't correctly set in the first round of commits. What would be the best way to deal with this? I presume this is why CLA-bot is stuck? |
We can merge it, you need no change for cabot |
Can you please squash all your commits and make sure they have the right email attached. Otherwise the CLA bot won't pass for the release either. |
@balloob Done! |
Awesome! Cherry-picked for 0.48 |
Description:
hass starts up very slow with a large SQL database. This adds an index to the states table to help (tremendously) with startup speed.
Related issue (if applicable): fixes #8176
Checklist:
If user exposed functionality or configuration variables are added/changed:
If the code does not interact with devices:
tox
run successfully. Your PR cannot be merged unless tests pass