TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

时间戳递增问题

Open Luozde opened this issue 7 years ago • 9 comments

您好,通过文档中说有所有的数据都是按时间戳递增,但我们有数据补传的场景,也就是说数据不一定是按递增的顺序过来?这样的场景需要怎样处理?

Luozde avatar Aug 12 '19 08:08 Luozde

insert命令要求时间戳递增,补传数据时,插入这部分数据可以用import命令。

fangpanpan avatar Aug 12 '19 09:08 fangpanpan

补传以后的数据,是不是就不是按时间戳递增了?这样的话会不会严重影响查询计算性能?

TS668 avatar Aug 12 '19 13:08 TS668

补传后的数据还是按时间戳递增的,影响会有一些,这取决于数据的乱序程度。数据乱序现象越严重,一个磁盘块包含的数据量越少,性能影响才会越大。

fangpanpan avatar Aug 12 '19 13:08 fangpanpan

补传以后还是按时间戳递增?你的意思是整个数据块重写了吗?那补传的速度岂不是非常慢?

TS668 avatar Aug 12 '19 16:08 TS668

一个小范围内无序的数据,这种情况TDengine会缓存其中一部分数据,影响不会很大。不过有时候import语句写入,可能会直接写文件,这样的话,会牵扯到拆块合并等问题。我们的import还有很大的优化空间,后续工作会慢慢将优化完成的。

fangpanpan avatar Aug 13 '19 00:08 fangpanpan

为什么不能把 insert 和 import 合成一个命令呢,有时候也不清楚后续的数据是不是需要 import 而不是 insert

willove avatar Aug 17 '19 10:08 willove

两个api的合并工作正在进行中

---原始邮件--- 发件人: "乐悠族"[email protected] 发送时间: 2019年8月17日(星期六) 晚上6:08 收件人: "taosdata/TDengine"[email protected]; 抄送: "Subscribed"[email protected]; 主题: Re: [taosdata/TDengine] 时间戳递增问题 (#331)

为什么不能把 insert 和 import 合成一个命令呢,有时候也不清楚后续的数据是不是需要 import 而不是 insert

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

hzcheng avatar Aug 17 '19 10:08 hzcheng

传感器是每5分钟采集一次,如果用采集时间作为时间戳的话,可以吗?但是不是递增的

SMD12138 avatar Oct 08 '19 08:10 SMD12138

同一个传感器采集的时间为什么不是递增的呢?

On Oct 8, 2019, at 4:34 PM, SMD12138 [email protected] wrote:

传感器是每5分钟采集一次,如果用采集时间作为时间戳的话,可以吗?但是不是递增的

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/taosdata/TDengine/issues/331?email_source=notifications&email_token=AFPSS2UU3RH64UKUJFQR4EDQNRA2HA5CNFSM4IK7FJU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEATMDPQ#issuecomment-539410878, or mute the thread https://github.com/notifications/unsubscribe-auth/AFPSS2UF5SYXCN3U5PLGKIDQNRA2HANCNFSM4IK7FJUQ.

hzcheng avatar Oct 08 '19 08:10 hzcheng