0

刚发现导入排序的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)
4

0 回答 0