J. Nick Koston

Results 1806 comments of J. Nick Koston

``` select attributes_id from states where attributes_id in ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 23, 25,...

doesn't really help ``` # explain select attributes_id from states where attributes_id in ( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,...

``` # explain SELECT inner_state_attributes.attributes_id AS attributes_id FROM state_attributes JOIN LATERAL ( SELECT states.attributes_id as attributes_id FROM states WHERE states.attributes_id = state_attributes.attributes_id LIMIT 1 ) AS inner_state_attributes ON true WHERE...

It probably makes more sense to set `slow_range_in_select` for PostgreSQL because it will be nearly as fast and we don't have to support another code branch

I ended up optimizing this a bit more in https://github.com/home-assistant/core/pull/133752

https://github.com/JurajNyiri/HomeAssistant-Tapo-Control/blob/34e16a155276e1ed16e40ca3f2edab57c739bde4/custom_components/tapo_control/__init__.py#L251 While it won't break, the unloads could be switched to use `await hass.config_entries.async_unload_platforms(entry, PLATFORMS)` instead as its more efficient