🏡 Open source home automation that puts local control and privacy first.
Go to file
J. Nick Koston 91e0395c1c
Optimize database indexes for existing queries (#37036)
Cleanup indexes as >50% of the db size was indexes,
many of them unused in any current query

Logbook search was having to filter event_types without
an index:

  Created ix_events_event_type_time_fired
  Dropped ix_events_event_type

States had a redundant keys on composite index:

  Dropped ix_states_entity_id
  Its unused since we have ix_states_entity_id_last_updated

De-duplicate storage of context in states as
its always stored in events and can be found
by joining the state on the event_id.

  Dropped ix_states_context_id
  Dropped ix_states_context_parent_id
  Dropped ix_states_context_user_id

After schema v9:

STATES............................................ 10186       40.9%
EVENTS............................................ 5502        22.1%
IX_STATES_ENTITY_ID_LAST_UPDATED.................. 2177         8.7%
IX_EVENTS_EVENT_TYPE_TIME_FIRED................... 1910         7.7%
IX_EVENTS_CONTEXT_ID.............................. 1592         6.4%
IX_EVENTS_TIME_FIRED.............................. 1383         5.6%
IX_STATES_LAST_UPDATED............................ 1079         4.3%
IX_STATES_EVENT_ID................................ 375          1.5%
IX_EVENTS_CONTEXT_PARENT_ID....................... 347          1.4%
IX_EVENTS_CONTEXT_USER_ID......................... 346          1.4%
IX_RECORDER_RUNS_START_END........................ 1            0.004%
RECORDER_RUNS..................................... 1            0.004%
SCHEMA_CHANGES.................................... 1            0.004%
SQLITE_MASTER..................................... 1            0.004%
2020-06-23 10:57:52 -07:00
.devcontainer Fixes invalid JSON syntax in devcontainer (#29911) 2019-12-13 12:41:56 +01:00
.github Correct inst method names in system info and issue templates (#36998) 2020-06-22 14:46:31 +02:00
.vscode Recommend python & prettier vscode extensions (#33702) 2020-04-05 18:19:40 +02:00
docs Improve string formatting v5 (#33697) 2020-04-05 17:48:55 +02:00
homeassistant Optimize database indexes for existing queries (#37036) 2020-06-23 10:57:52 -07:00
rootfs Disable jemalloc via specific ENV variable, see Issue#36237 (#36274) 2020-06-03 01:08:50 +02:00
script Remove loading of legacy translations (#37021) 2020-06-23 10:58:11 +02:00
tests Optimize database indexes for existing queries (#37036) 2020-06-23 10:57:52 -07:00
.coveragerc Fix/Rewrite of Toon integration (#36952) 2020-06-22 18:22:41 -07:00
.dockerignore Integrate dockerbuild (#33168) 2020-03-23 00:39:37 +01:00
.gitattributes highlight Dockerfile.dev as Dockerfile in github ui (#36933) 2020-06-22 14:45:57 +02:00
.gitignore Add .env file to .gitignore for vscode environment settings (#35200) 2020-05-17 15:17:05 +02:00
.hadolint.yaml Add hadolint to CI (#34758) 2020-04-27 12:09:31 +02:00
.ignore Include .ignore file for search utilities (#5290) 2017-01-16 22:52:53 -08:00
.pre-commit-config.yaml Run pre-commit gen_requirements_all on pre-commit config changes (#35588) 2020-05-14 07:24:27 +02:00
.prettierignore Rename translations dir for integrations (#34494) 2020-04-21 16:11:05 -07:00
.readthedocs.yml Drop Python 3.6 support (#29978) 2019-12-16 07:29:19 +01:00
.travis.yml Use savoury1/ffmpeg4 PPA on Travis, PyAV 7 needs FFmpeg >= 4 (#35090) 2020-05-02 14:52:29 -07:00
.yamllint Add yamllint (in pre-commit and CI) (#33676) 2020-04-05 10:33:45 +02:00
CLA.md Update LICENSE.md and CLA.md to reflect the new Apache 2.0 license 2017-01-28 12:12:34 -08:00
CODEOWNERS Add new humidifier entity integration (#28693) 2020-06-22 17:59:16 -07:00
CODE_OF_CONDUCT.md Update Code of Conduct to 2.0 (#36142) 2020-05-25 19:40:40 -04:00
CONTRIBUTING.md Contributing: Add note about feature suggestions and bug tracking (#30225) 2019-12-30 17:54:16 +01:00
Dockerfile Fix shutdown timeout and make it upstream with Supervisor (#33973) 2020-04-10 22:04:50 +02:00
Dockerfile.dev Add non-root dev container user (#34984) 2020-06-03 09:55:25 +02:00
LICENSE.md Update license to official GitHub template (#16470) 2018-09-07 10:11:51 +02:00
MANIFEST.in Consolidate frontend (#9915) 2017-10-24 19:36:27 -07:00
README.rst Adjusts repository README (#29805) 2019-12-10 09:22:37 +01:00
azure-pipelines-ci.yml Bump codecov to 2.1.0 (#35808) 2020-05-19 13:08:36 -04:00
azure-pipelines-release.yml Integrate dockerbuild (#33168) 2020-03-23 00:39:37 +01:00
azure-pipelines-translation.yml Migrate translations upload (#33926) 2020-04-09 17:52:33 -07:00
azure-pipelines-wheels.yml Update azure-pipelines-wheels.yml for Azure Pipelines 2020-04-02 09:38:43 +02:00
build.json Fix CVE-2020-1967 (#34853) 2020-04-29 18:06:25 +02:00
codecov.yml Update Codecov.io configuration (#33783) 2020-04-07 09:01:01 -07:00
pylintrc Pylint cleanups (#35409) 2020-05-09 14:08:40 +03:00
pyproject.toml Drop Python 3.6 support (#29978) 2019-12-16 07:29:19 +01:00
requirements_all.txt Updated frontend to 20200623.2 (#37035) 2020-06-23 10:37:32 -07:00
requirements_docs.txt Refactor API documentation (#33217) 2020-03-25 13:21:04 -07:00
requirements_test.txt Upgrade pytest-cov to 2.10.0 (#36720) 2020-06-13 02:37:59 +02:00
requirements_test_all.txt Updated frontend to 20200623.2 (#37035) 2020-06-23 10:37:32 -07:00
requirements_test_pre_commit.txt Upgrade flake8 to 3.8.1, fix findings (#35578) 2020-05-13 17:14:30 -05:00
setup.cfg Upgrade mypy to 0.770, tighten config a bit (#32715) 2020-03-12 11:52:20 +01:00
setup.py Upgrade requests to 2.24.0 (#36886) 2020-06-17 16:26:29 -07:00
tox.ini Fix hassfest validate invocation in Tox (#34428) 2020-04-19 17:43:49 +02:00

README.rst

Home Assistant |Chat Status|
=================================================================================

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

Check out `home-assistant.io <https://home-assistant.io>`__ for `a
demo <https://home-assistant.io/demo/>`__, `installation instructions <https://home-assistant.io/getting-started/>`__,
`tutorials <https://home-assistant.io/getting-started/automation-2/>`__ and `documentation <https://home-assistant.io/docs/>`__.

|screenshot-states|

Featured integrations
---------------------

|screenshot-components|

The system is built using a modular approach so support for other devices or actions can be implemented easily. See also the `section on architecture <https://developers.home-assistant.io/docs/en/architecture_index.html>`__ and the `section on creating your own
components <https://developers.home-assistant.io/docs/en/creating_component_index.html>`__.

If you run into issues while using Home Assistant or during development
of a component, check the `Home Assistant help section <https://home-assistant.io/help/>`__ of our website for further help and information.

.. |Chat Status| image:: https://img.shields.io/discord/330944238910963714.svg
   :target: https://discord.gg/c5DvZ4e
.. |screenshot-states| image:: https://raw.github.com/home-assistant/home-assistant/master/docs/screenshots.png
   :target: https://home-assistant.io/demo/
.. |screenshot-components| image:: https://raw.github.com/home-assistant/home-assistant/dev/docs/screenshot-components.png
   :target: https://home-assistant.io/integrations/