* 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'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 "synthetic zero data point" 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't work when no `filters` was passed in to the method. Now it'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
|
||
---|---|---|
.. | ||
components | ||
helpers | ||
scripts | ||
util | ||
__init__.py | ||
__main__.py | ||
bootstrap.py | ||
config.py | ||
const.py | ||
core.py | ||
exceptions.py | ||
loader.py | ||
monkey_patch.py | ||
package_constraints.txt | ||
remote.py | ||
setup.py |