Table design for multiple time series data

五迷三道 提交于 2020-06-17 07:45:22

问题


I have more than 200 separate time series data(each represent one variable) that I gather from different sources/REST API calls.

The frequency of each variable is different. Example temperature data is coming at very high frequency, but status data is very less frequent.

I am looking for suggestions for scalable table design to store these data. If I store all the data in one table with timestamp being the key, I think the table will have so much nulls.


回答1:


Based on your description, my first thought is something like this:

Create Table Data_Type
(
    ID Int Identity
    , Data_Type_Description VarChar(100)
)

Create Table Data_Values
(
    ID Int Identity
    , Data_Value_Time_Stamp TimeStamp
    , Data_Type_ID Int       -- foreign key to Data_Type
    , Value Numeric(17, 4)   -- I'm guessing here
)

Does that make sense?



来源:https://stackoverflow.com/questions/54587600/table-design-for-multiple-time-series-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!