expaso / hassos-addons

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

Create index on (entity_id, time) #4

Closed sithmein closed 4 years ago

sithmein commented 4 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 4 years ago

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