taosdata / TDengine

TDengine is an open source, high-performance, cloud native time-series database optimized for Internet of Things (IoT), Connected Cars, Industrial IoT and DevOps.

Home Page:https://tdengine.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

what to do with fields that needs to be updated

chessplay opened this issue · comments

如何处理需要更新的字段?
假设我有一组数据 包括下面几个字段:设备id,项目id,设备流量,用设备id作为表名,设备流量作为指标。现在的问题是:项目id要如何处理,因为同一个设备的项目id会发生变化,从业务上来说,一个设备一开始属于项目1,用了一段时间后会变更到项目2,但变更的频率不会太频繁。但是因为会产生变更,项目id就不能用作tag。这种情况下,项目id是作为采集量比较好,还是和设备id一起放到表名上比较好?怎么设计比较高效?我们的查询需求会基于设备id对流量聚合统计,也会基于项目id对流量统计

两个都作为TAG,也要放在表名上比较好