多个时间序列数据的表格设计 [英] Table design for multiple time series data

查看:279
本文介绍了多个时间序列数据的表格设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从不同的来源/ REST API调用中收集了200多个单独的时间序列数据(每个代表一个变量)。

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.

推荐答案

根据您的描述,我的第一个想法是这样的:

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
)

这有意义吗?

这篇关于多个时间序列数据的表格设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆