Company
Date Published
Author
Chris Engelbert
Word count
1912
Language
English
Hacker News points
None

Summary

Designing metadata tables to store series definitions can greatly enhance querying performance, especially when it comes to filtering data by time range. The proposed approach involves creating two separate tables: `series_metadata` and `assignment_buildings_devices`. The first table stores information about each data series, including its start and end times, while the second table links devices to buildings. By joining these tables with a query, users can quickly retrieve all available data series for a specific customer and time range. This approach offers several benefits, including improved performance, reduced storage space requirements, and the ability to optimize queries based on exact time ranges. Additionally, it enables quick lookups of available data series, finding previous assignments of devices and sensors, and providing information about similar parallel but distinct data series in a given time range. Overall, implementing this metadata table design can be beneficial for various use cases involving time-series data.