|
Ran
|
Files
272
|
Run time
11s
|
Badge
README BADGES
|
push
travis-ci
<a href="https://github.com/home-assistant/home-assistant/commit/<a class=hub.com/home-assistant/home-assistant/commit/438edc5ca115a3a02bbc3887bdaafaf8ab24eb8e">438edc5ca<a href="https://github.com/home-assistant/home-assistant/commit/438edc5ca115a3a02bbc3887bdaafaf8ab24eb8e">">History performance improvements for single-entity requests (#8632) * Bugfix: remove superfluous domain filter This filter is already applied later in the function by the `filters` object, where it is conditionally applied when appropriate. This fixes the problem where we get a domain filter even when searching for a single entity_id, which needlessly harms the query&#39;s performance. * Performance: build different query when only getting single entity When querying the history of a single entity, we can use an entirely different method for the &quot;synthetic zero data point&quot; by simply sorting by date and doing a LIMIT 1. This performs thousands of times better than the multi-entity query when the current recorder_run has been going for a while. * Add entity_id filter to single-entity request The entity_id filter was handled inside the `filters.apply` logic which is used in most cases, BUT didn&#39;t work when no `filters` was passed in to the method. Now it&#39;ll work even if no `filters` object is passed in. * Fix linting errors in history.py * Undo removal of domain filter Putting back the domain filter that was removed in </a><a class="double-link" href="https://github.com/home-assistant/home-assistant/commit/<a class="double-link" href="https://github.com/home-assistant/home-assistant/commit/76a6371705dcd57483e55dcc03435ae867c184d2">76a637170</a>">76a637170</a><a href="https://github.com/home-assistant/home-assistant/commit/438edc5ca115a3a02bbc3887bdaafaf8ab24eb8e"> - there are use-cases where get_states is called without a filter object, so we need the domain filter to work in those cases as well. * Fix truncated comment
23252 of 24839 relevant lines covered (93.61%)
0.94 hits per line
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
|---|