【发布时间】:2022-04-30 16:22:47
【问题描述】:
刚发现导入排序后的csv文件的速度比导入TDengine数据库中未排序的csv文件的速度要快,每个csv文件有1000000行,唯一的区别是一个文件有时间戳排序,另一个文件有时间戳未排序。
谁能解释为什么导入排序后的 csv 文件更快?
taos> create table if not exists t1(ts timestamp, c1 int, c2 float, c3 int, c4 int);
Query OK, 0 of 0 row(s) in database (0.001659s)
taos> insert into t1 file 'unsorted.csv';
Query OK, 1000000 of 1000000 row(s) in database (2.025508s)
taos> create table if not exists t2(ts timestamp, c1 int, c2 float, c3 int, c4 int);
Query OK, 0 of 0 row(s) in database (0.001335s)
taos> insert into t2 file 'sorted.csv';
Query OK, 1000000 of 1000000 row(s) in database (0.994504s)
【问题讨论】:
标签: sql database time-series iot tdengine