iotdb icon indicating copy to clipboard operation
iotdb copied to clipboard

跨设备查询时的时间排序问题

Open SunnySaman opened this issue 2 years ago • 5 comments

跨设备查询时的时间排序问题

现在iotdb 0.13.1 版本中时间跨设备查询时,进行时间排序,是先根据设备进行的排序,再根据时间进行的排序。

请问,如何实现在跨设备查询的时候依然先根据时间排序 ?

SunnySaman avatar Aug 12 '22 08:08 SunnySaman

current align by device sql does not support align by device first and then align by time.

But using the default query, you can get the result order by time. However, this kind of query is not friendly for cases which have many devices.

IoTDB> insert into root.sg1.d1(time, s1) values (1, 2);
Msg: The statement is executed successfully.
IoTDB> insert into root.sg1.d1(time, s1) values (5, 2);
Msg: The statement is executed successfully.
IoTDB> insert into root.sg1.d2(time, s1) values (3, 2);
Msg: The statement is executed successfully.
IoTDB> select * from root.**;
+-----------------------------+--------------+--------------+
|                         Time|root.sg1.d1.s1|root.sg1.d2.s1|
+-----------------------------+--------------+--------------+
|1970-01-01T08:00:00.001+08:00|           2.0|          null|
|1970-01-01T08:00:00.003+08:00|          null|           2.0|
|1970-01-01T08:00:00.005+08:00|           2.0|          null|
+-----------------------------+--------------+--------------+
Total line number = 3
It costs 0.182s
IoTDB> select * from root.** align by device;
+-----------------------------+-----------+---+
|                         Time|     Device| s1|
+-----------------------------+-----------+---+
|1970-01-01T08:00:00.001+08:00|root.sg1.d1|2.0|
|1970-01-01T08:00:00.005+08:00|root.sg1.d1|2.0|
|1970-01-01T08:00:00.003+08:00|root.sg1.d2|2.0|
+-----------------------------+-----------+---+
Total line number = 3
It costs 0.047s

jixuan1989 avatar Aug 14 '22 08:08 jixuan1989

dddd

jiangxinwei2008 avatar Aug 25 '22 03:08 jiangxinwei2008

@qiaojialin 乔老师,请问跨设备时间排序,优先时间排序,再设备排序的功能 有计划进行开发嘛 ?多谢

SunnySaman avatar Sep 08 '22 07:09 SunnySaman

will consider this feature.

jixuan1989 avatar Oct 01 '22 06:10 jixuan1989

我这边也有同样的跨设备时间排序,优先时间排序需求,乔老师能在下个版本中增加这个功能吗?感谢

xiaobai158269 avatar Oct 12 '22 10:10 xiaobai158269

@qiaojialin 请问1.0版本 增加了这个 优先时间排序的功能了吗 ?

SunnySaman avatar Dec 27 '22 06:12 SunnySaman