问题
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