Skip to content

index on sql database to allow hass to startup quickly with a large sql database#8255

Merged
balloob merged 1 commit into
home-assistant:devfrom
cmsimike:index-for-hass-startup
Jul 1, 2017
Merged

index on sql database to allow hass to startup quickly with a large sql database#8255
balloob merged 1 commit into
home-assistant:devfrom
cmsimike:index-for-hass-startup

Conversation

@cmsimike
Copy link
Copy Markdown
Contributor

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:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • [na] Tests have been added to verify that the new code works.

@mention-bot
Copy link
Copy Markdown

@cmsimike, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rhooper, @balloob and @m00dawg to be potential reviewers.

@cmsimike
Copy link
Copy Markdown
Contributor Author

cmsimike commented Jun 30, 2017

@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 :(

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@cmsimike
Copy link
Copy Markdown
Contributor Author

cmsimike commented Jul 1, 2017

@balloob @pvizeli I believe I have submitted the changes as requested, however Travis is failing for reasons unknown to me - tox passes in my dev env:
Results (303.52s):
2204 passed
50 skipped

Please advise?

@cmsimike
Copy link
Copy Markdown
Contributor Author

cmsimike commented Jul 1, 2017

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?

@pvizeli
Copy link
Copy Markdown
Member

pvizeli commented Jul 1, 2017

We can merge it, you need no change for cabot

@balloob
Copy link
Copy Markdown
Member

balloob commented Jul 1, 2017

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.

@cmsimike
Copy link
Copy Markdown
Contributor Author

cmsimike commented Jul 1, 2017

@balloob Done!

@balloob balloob merged commit 0bf5021 into home-assistant:dev Jul 1, 2017
@balloob
Copy link
Copy Markdown
Member

balloob commented Jul 1, 2017

Awesome! Cherry-picked for 0.48

@balloob balloob mentioned this pull request Jul 1, 2017
@balloob balloob mentioned this pull request Jul 13, 2017
dethpickle pushed a commit to dethpickle/home-assistant that referenced this pull request Aug 18, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

15 minute restart time after 0.46 (yes 46)

6 participants