expaso / hassos-addons

Home Assistant Add-ons
Apache License 2.0
51 stars 14 forks source link

Create index on (entity_id, time) #4

Closed sithmein closed 3 years ago

sithmein commented 3 years ago

Currently the TimescaleDB extension creates two indexes, on on entity_id and one on time. However, most queries will filter by both entity and time and therefore a compound index on both (entity_id, time DESC) will improve those queries considerably. The TimescaleDB manual also suggests creating such indexes.

sithmein commented 3 years ago

I realized, this is the wrong project. Submitted it again as https://github.com/Expaso/hassos-addon-timescaledb/issues/6.