Copyright (c) 2022 by TDengine, all rights reserved. taos> source tsim/query/t/explain_tsorder.sql taos> use test; Database changed. taos> explain verbose true select _wstart, last(ts), avg(c2) from meters interval(10s) order by _wstart desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=desc output_order=desc) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 4.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 5.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=desc output_order=desc) *************************** 6.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 7.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 8.row *************************** QUERY_PLAN: Merge Key: _group_id asc, desc *************************** 9.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 10.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 11.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=desc ) *************************** 12.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 13.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 14.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 15.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 19.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 20.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=desc ) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 23.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 24.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 25.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 26.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, last(ts), avg(c2) from meters interval(10s) order by _wstart asc\G; *************************** 1.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 4.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 5.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 6.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 7.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 8.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 9.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 10.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 11.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 12.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 13.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 14.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 15.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 19.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 20.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 23.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 24.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 25.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 26.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, first(ts), avg(c2) from meters interval(10s) order by _wstart asc\G; *************************** 1.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 4.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 5.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 6.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 7.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 8.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 9.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 10.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 11.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=asc output_order=asc ) *************************** 12.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 13.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 14.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 15.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 19.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 20.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=asc output_order=asc ) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 23.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 24.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 25.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 26.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, first(ts), avg(c2) from meters interval(10s) order by _wstart desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=desc output_order=desc) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 4.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 5.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=desc output_order=desc) *************************** 6.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 7.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 8.row *************************** QUERY_PLAN: Merge Key: _group_id asc, desc *************************** 9.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 10.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 11.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=asc output_order=desc ) *************************** 12.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 13.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 14.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 15.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 19.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 20.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=asc output_order=desc ) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 23.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 24.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 25.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 26.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s)) order by d\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=asc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=8 input_order=asc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=asc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 14.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 15.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 16.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 17.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 19.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 20.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 23.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 24.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 25.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 26.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 27.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 28.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 29.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 32.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 33.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 34.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 35.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s)) order by d desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=desc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=8 input_order=asc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=asc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 14.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 15.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 16.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 17.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 19.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 20.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 23.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 24.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 25.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 26.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 27.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 28.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 29.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 32.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 33.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 34.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 35.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a) order by d\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=asc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=8 input_order=asc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=asc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 14.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 15.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 16.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 17.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 19.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 20.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 23.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 24.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 25.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 26.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 27.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 28.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 29.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 32.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 33.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 34.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 35.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) order by d\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=asc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=8 input_order=desc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=desc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=desc output_order=desc) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 14.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=desc output_order=desc) *************************** 15.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 16.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 17.row *************************** QUERY_PLAN: Merge Key: _group_id asc, desc *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 19.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 20.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=desc ) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 23.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 24.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 25.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 26.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 27.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 28.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 29.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=desc ) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 32.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 33.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 34.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 35.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a) order by d desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=desc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=8 input_order=asc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=asc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 14.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 15.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 16.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 17.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 19.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 20.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 23.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 24.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 25.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 26.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 27.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 28.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 29.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 32.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 33.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 34.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 35.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) order by d desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=desc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=8 input_order=desc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=desc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=desc output_order=desc) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 14.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=desc output_order=desc) *************************** 15.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 16.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 17.row *************************** QUERY_PLAN: Merge Key: _group_id asc, desc *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 19.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 20.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=desc ) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 23.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 24.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 25.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 26.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 27.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 28.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 29.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=desc ) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 32.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 33.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 34.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 35.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b) order by d\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=asc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=8 input_order=unknown ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=unknown ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 13.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 14.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 15.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 16.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 18.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 19.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 20.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 23.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 24.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 25.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 26.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 29.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 32.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 33.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 34.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 35.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 36.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 37.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) order by d\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=asc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=8 input_order=unknown ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=unknown ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 13.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 14.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 15.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 16.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 18.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 19.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 20.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 23.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 24.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 25.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 26.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 29.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 32.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 33.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 34.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 35.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 36.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 37.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b) order by d desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=desc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=8 input_order=unknown ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=unknown ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 13.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 14.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 15.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 16.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 18.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 19.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 20.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 23.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 24.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 25.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 26.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 29.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 32.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 33.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 34.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 35.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 36.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 37.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) order by d desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=desc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=8 input_order=unknown ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=unknown ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 13.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 14.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 15.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 16.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 18.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 19.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 20.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 23.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 24.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 25.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 26.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 29.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 32.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 33.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 34.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 35.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 36.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 37.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b) group by c order by d\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=asc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=16 groups=1 input_order=unknown ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=unknown ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 13.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 14.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 15.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 16.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 18.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 19.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 20.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 23.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 24.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 25.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 26.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 29.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 32.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 33.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 34.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 35.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 36.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 37.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) group by c order by d\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=asc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=16 groups=1 input_order=unknown ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=unknown ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 13.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 14.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 15.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 16.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 18.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 19.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 20.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 23.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 24.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 25.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 26.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 29.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 32.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 33.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 34.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 35.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 36.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 37.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b) group by c order by d desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=desc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=16 groups=1 input_order=unknown ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=unknown ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 13.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 14.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 15.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 16.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 18.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 19.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 20.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 23.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 24.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 25.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 26.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 29.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 32.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 33.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 34.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 35.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 36.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 37.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) group by c order by d desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=desc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Aggragate (functions=1 width=16 groups=1 input_order=unknown ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 5.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 6.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=unknown ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 10.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 13.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 14.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 15.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 16.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 18.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 19.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 20.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 21.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 22.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 23.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 24.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 25.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 26.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 29.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 30.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 31.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 32.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 33.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 34.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 35.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 36.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 37.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b) where a > 10000 and a < 20000 interval(10s) fill(NULL) order by d\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=asc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Fill (mode=null width=24 input_order=unknown ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 5.row *************************** QUERY_PLAN: Time Range: [10001, 19999] *************************** 6.row *************************** QUERY_PLAN: -> Interval on Column a (functions=2 width=16 input_order=asc output_order=asc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 8.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 10.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=unknown ) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 14.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 15.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 16.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 18.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 19.row *************************** QUERY_PLAN: Filter: ((a > 10000) AND (a < 20000)) *************************** 20.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 21.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 22.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 23.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 24.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 25.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 26.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 27.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 28.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 29.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 30.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 31.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 32.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 33.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 34.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 35.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 36.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 37.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 38.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 39.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 40.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 41.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 42.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) where a > 10000 and a < 20000 interval(10s) fill(NULL) order by d\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=asc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Fill (mode=null width=24 input_order=asc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 5.row *************************** QUERY_PLAN: Time Range: [10001, 19999] *************************** 6.row *************************** QUERY_PLAN: -> Interval on Column a (functions=2 width=16 input_order=desc output_order=asc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 8.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 10.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=desc ) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 14.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=desc output_order=desc) *************************** 15.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 16.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 17.row *************************** QUERY_PLAN: Filter: ((a > 10000) AND (a < 20000)) *************************** 18.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 19.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=desc output_order=desc) *************************** 20.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 21.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 22.row *************************** QUERY_PLAN: Merge Key: _group_id asc, desc *************************** 23.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 24.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 25.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=desc ) *************************** 26.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 27.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 28.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 29.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 30.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 31.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 32.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 33.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 34.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=desc ) *************************** 35.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 36.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 37.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 38.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 39.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 40.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(b) as d from (select last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) where b > 10000 and b < 20000 interval(10s) fill(NULL) order by d\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=asc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Fill (mode=null width=24 input_order=asc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 5.row *************************** QUERY_PLAN: Time Range: [10001, 19999] *************************** 6.row *************************** QUERY_PLAN: -> Interval on Column b (functions=2 width=16 input_order=desc output_order=asc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 8.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 10.row *************************** QUERY_PLAN: -> Projection (columns=2 width=16 input_order=desc ) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 12.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 14.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=2 width=16) *************************** 15.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 16.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=2 width=16 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 18.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 19.row *************************** QUERY_PLAN: Filter: ((b > 10000) AND (b < 20000)) *************************** 20.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 21.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 22.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 23.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 24.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 25.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 26.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 27.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 28.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 29.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 30.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 31.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 32.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 33.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 34.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 35.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 36.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 37.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 38.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 39.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 40.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 41.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 42.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select last(b) as d from (select last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) where b > 10000 and b < 20000 interval(10s) fill(NULL) order by d desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=1 width=8) *************************** 2.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 3.row *************************** QUERY_PLAN: -> Fill (mode=null width=24 input_order=asc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 5.row *************************** QUERY_PLAN: Time Range: [10001, 19999] *************************** 6.row *************************** QUERY_PLAN: -> Interval on Column b (functions=2 width=16 input_order=desc output_order=asc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 8.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 10.row *************************** QUERY_PLAN: -> Projection (columns=2 width=16 input_order=desc ) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 12.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 14.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=2 width=16) *************************** 15.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 16.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=2 width=16 input_order=asc output_order=asc) *************************** 17.row *************************** QUERY_PLAN: Output: columns=2 width=16 *************************** 18.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 19.row *************************** QUERY_PLAN: Filter: ((b > 10000) AND (b < 20000)) *************************** 20.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 21.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 22.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 23.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 24.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 25.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 26.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 27.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 28.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 29.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 30.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 31.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 32.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 33.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 34.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 35.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 36.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 37.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 38.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 39.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 40.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 41.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 42.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> select _wstart, last(ts), avg(c2) from meters interval(10s) order by _wstart desc; _wstart | last(ts) | avg(c2) | ================================================================================ 2022-05-24 00:01:00.000 | 2022-05-24 00:01:08.000 | 210.000000000000000 | 2022-05-23 00:01:00.000 | 2022-05-23 00:01:08.000 | 116.000000000000000 | 2022-05-22 00:01:00.000 | 2022-05-22 00:01:08.000 | 196.000000000000000 | 2022-05-21 00:01:00.000 | 2022-05-21 00:01:08.000 | 11.000000000000000 | 2022-05-20 00:01:00.000 | 2022-05-20 00:01:08.000 | 120.000000000000000 | 2022-05-19 00:01:00.000 | 2022-05-19 00:01:08.000 | 243.000000000000000 | 2022-05-18 00:01:00.000 | 2022-05-18 00:01:08.000 | 58.000000000000000 | 2022-05-17 00:01:00.000 | 2022-05-17 00:01:08.000 | 59.000000000000000 | 2022-05-16 00:01:00.000 | 2022-05-16 00:01:08.000 | 136.000000000000000 | 2022-05-15 00:01:00.000 | 2022-05-15 00:01:08.000 | 234.000000000000000 | taos> select _wstart, last(ts), avg(c2) from meters interval(10s) order by _wstart asc; _wstart | last(ts) | avg(c2) | ================================================================================ 2022-05-15 00:01:00.000 | 2022-05-15 00:01:08.000 | 234.000000000000000 | 2022-05-16 00:01:00.000 | 2022-05-16 00:01:08.000 | 136.000000000000000 | 2022-05-17 00:01:00.000 | 2022-05-17 00:01:08.000 | 59.000000000000000 | 2022-05-18 00:01:00.000 | 2022-05-18 00:01:08.000 | 58.000000000000000 | 2022-05-19 00:01:00.000 | 2022-05-19 00:01:08.000 | 243.000000000000000 | 2022-05-20 00:01:00.000 | 2022-05-20 00:01:08.000 | 120.000000000000000 | 2022-05-21 00:01:00.000 | 2022-05-21 00:01:08.000 | 11.000000000000000 | 2022-05-22 00:01:00.000 | 2022-05-22 00:01:08.000 | 196.000000000000000 | 2022-05-23 00:01:00.000 | 2022-05-23 00:01:08.000 | 116.000000000000000 | 2022-05-24 00:01:00.000 | 2022-05-24 00:01:08.000 | 210.000000000000000 | taos> select _wstart, first(ts), avg(c2) from meters interval(10s) order by _wstart asc; _wstart | first(ts) | avg(c2) | ================================================================================ 2022-05-15 00:01:00.000 | 2022-05-15 00:01:08.000 | 234.000000000000000 | 2022-05-16 00:01:00.000 | 2022-05-16 00:01:08.000 | 136.000000000000000 | 2022-05-17 00:01:00.000 | 2022-05-17 00:01:08.000 | 59.000000000000000 | 2022-05-18 00:01:00.000 | 2022-05-18 00:01:08.000 | 58.000000000000000 | 2022-05-19 00:01:00.000 | 2022-05-19 00:01:08.000 | 243.000000000000000 | 2022-05-20 00:01:00.000 | 2022-05-20 00:01:08.000 | 120.000000000000000 | 2022-05-21 00:01:00.000 | 2022-05-21 00:01:08.000 | 11.000000000000000 | 2022-05-22 00:01:00.000 | 2022-05-22 00:01:08.000 | 196.000000000000000 | 2022-05-23 00:01:00.000 | 2022-05-23 00:01:08.000 | 116.000000000000000 | 2022-05-24 00:01:00.000 | 2022-05-24 00:01:08.000 | 210.000000000000000 | taos> select _wstart, first(ts), avg(c2) from meters interval(10s) order by _wstart desc; _wstart | first(ts) | avg(c2) | ================================================================================ 2022-05-24 00:01:00.000 | 2022-05-24 00:01:08.000 | 210.000000000000000 | 2022-05-23 00:01:00.000 | 2022-05-23 00:01:08.000 | 116.000000000000000 | 2022-05-22 00:01:00.000 | 2022-05-22 00:01:08.000 | 196.000000000000000 | 2022-05-21 00:01:00.000 | 2022-05-21 00:01:08.000 | 11.000000000000000 | 2022-05-20 00:01:00.000 | 2022-05-20 00:01:08.000 | 120.000000000000000 | 2022-05-19 00:01:00.000 | 2022-05-19 00:01:08.000 | 243.000000000000000 | 2022-05-18 00:01:00.000 | 2022-05-18 00:01:08.000 | 58.000000000000000 | 2022-05-17 00:01:00.000 | 2022-05-17 00:01:08.000 | 59.000000000000000 | 2022-05-16 00:01:00.000 | 2022-05-16 00:01:08.000 | 136.000000000000000 | 2022-05-15 00:01:00.000 | 2022-05-15 00:01:08.000 | 234.000000000000000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s)) order by d; d | ========================== 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s)) order by d desc; d | ========================== 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a) order by d; d | ========================== 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) order by d; d | ========================== 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a) order by d desc; d | ========================== 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) order by d desc; d | ========================== 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b) order by d; d | ========================== 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) order by d; d | ========================== 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b) order by d desc; d | ========================== 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) order by d desc; d | ========================== 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b) group by c order by d d | ========================== 2022-05-15 00:01:00.000 | 2022-05-16 00:01:00.000 | 2022-05-17 00:01:00.000 | 2022-05-18 00:01:00.000 | 2022-05-19 00:01:00.000 | 2022-05-20 00:01:00.000 | 2022-05-21 00:01:00.000 | 2022-05-22 00:01:00.000 | 2022-05-23 00:01:00.000 | 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) group by c order by d; d | ========================== 2022-05-15 00:01:00.000 | 2022-05-16 00:01:00.000 | 2022-05-17 00:01:00.000 | 2022-05-18 00:01:00.000 | 2022-05-19 00:01:00.000 | 2022-05-20 00:01:00.000 | 2022-05-21 00:01:00.000 | 2022-05-22 00:01:00.000 | 2022-05-23 00:01:00.000 | 2022-05-24 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b) group by c order by d desc; d | ========================== 2022-05-24 00:01:00.000 | 2022-05-23 00:01:00.000 | 2022-05-22 00:01:00.000 | 2022-05-21 00:01:00.000 | 2022-05-20 00:01:00.000 | 2022-05-19 00:01:00.000 | 2022-05-18 00:01:00.000 | 2022-05-17 00:01:00.000 | 2022-05-16 00:01:00.000 | 2022-05-15 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) group by c order by d desc; d | ========================== 2022-05-24 00:01:00.000 | 2022-05-23 00:01:00.000 | 2022-05-22 00:01:00.000 | 2022-05-21 00:01:00.000 | 2022-05-20 00:01:00.000 | 2022-05-19 00:01:00.000 | 2022-05-18 00:01:00.000 | 2022-05-17 00:01:00.000 | 2022-05-16 00:01:00.000 | 2022-05-15 00:01:00.000 | taos> select last(a) as d from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) where a > '2022-05-15 00:01:00.000' and a < '2022-05-19 00:01:08.000' interval(10s) order by d; d | ========================== 2022-05-15 00:01:00.000 | 2022-05-16 00:01:00.000 | 2022-05-17 00:01:00.000 | 2022-05-18 00:01:00.000 | 2022-05-19 00:01:00.000 | taos> select last(b) as d from (select last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) where b > '2022-05-15 00:01:00.000' and b < '2022-05-19 00:01:08.000' interval(10s) order by d; d | ========================== 2022-05-15 00:01:08.000 | 2022-05-16 00:01:08.000 | 2022-05-17 00:01:08.000 | 2022-05-18 00:01:08.000 | 2022-05-24 00:01:08.000 | taos> select last(b) as d from (select last(ts) as b, avg(c2) as c from meters interval(10s) order by b desc) where b > '2022-05-15 00:01:00.000' and b < '2022-05-19 00:01:08.000' interval(10s) order by d desc; d | ========================== 2022-05-24 00:01:08.000 | 2022-05-18 00:01:08.000 | 2022-05-17 00:01:08.000 | 2022-05-16 00:01:08.000 | 2022-05-15 00:01:08.000 | taos> select _wstart, first(a) as d, avg(c) from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) where a > '2022-05-15 00:01:00.000' and a < '2022-05-21 00:01:08.000' interval(5h) fill(linear) order by d desc; _wstart | d | avg(c) | ================================================================================ 2022-05-20 20:00:00.000 | 2022-05-21 00:01:00.000 | 11.000000000000000 | 2022-05-20 15:00:00.000 | 2022-05-20 18:01:00.000 | 38.250000000000000 | 2022-05-20 10:00:00.000 | 2022-05-20 12:01:00.000 | 65.500000000000000 | 2022-05-20 05:00:00.000 | 2022-05-20 06:01:00.000 | 92.750000000000000 | 2022-05-20 00:00:00.000 | 2022-05-20 00:01:00.000 | 120.000000000000000 | 2022-05-19 19:00:00.000 | 2022-05-19 19:13:00.000 | 144.599999999999994 | 2022-05-19 14:00:00.000 | 2022-05-19 14:25:00.000 | 169.199999999999989 | 2022-05-19 09:00:00.000 | 2022-05-19 09:37:00.000 | 193.800000000000011 | 2022-05-19 04:00:00.000 | 2022-05-19 04:49:00.000 | 218.400000000000006 | 2022-05-18 23:00:00.000 | 2022-05-19 00:01:00.000 | 243.000000000000000 | 2022-05-18 18:00:00.000 | 2022-05-18 19:13:00.000 | 206.000000000000000 | 2022-05-18 13:00:00.000 | 2022-05-18 14:25:00.000 | 169.000000000000000 | 2022-05-18 08:00:00.000 | 2022-05-18 09:37:00.000 | 132.000000000000000 | 2022-05-18 03:00:00.000 | 2022-05-18 04:49:00.000 | 95.000000000000000 | 2022-05-17 22:00:00.000 | 2022-05-18 00:01:00.000 | 58.000000000000000 | 2022-05-17 17:00:00.000 | 2022-05-17 19:13:00.000 | 58.200000000000003 | 2022-05-17 12:00:00.000 | 2022-05-17 14:25:00.000 | 58.399999999999999 | 2022-05-17 07:00:00.000 | 2022-05-17 09:37:00.000 | 58.600000000000001 | 2022-05-17 02:00:00.000 | 2022-05-17 04:49:00.000 | 58.799999999999997 | 2022-05-16 21:00:00.000 | 2022-05-17 00:01:00.000 | 59.000000000000000 | 2022-05-16 16:00:00.000 | 2022-05-16 19:13:00.000 | 74.400000000000006 | 2022-05-16 11:00:00.000 | 2022-05-16 14:25:00.000 | 89.799999999999997 | 2022-05-16 06:00:00.000 | 2022-05-16 09:37:00.000 | 105.200000000000003 | 2022-05-16 01:00:00.000 | 2022-05-16 04:49:00.000 | 120.599999999999994 | 2022-05-15 20:00:00.000 | 2022-05-16 00:01:00.000 | 136.000000000000000 | 2022-05-15 15:00:00.000 | 2022-05-15 18:01:00.000 | 160.500000000000000 | 2022-05-15 10:00:00.000 | 2022-05-15 12:01:00.000 | 185.000000000000000 | 2022-05-15 05:00:00.000 | 2022-05-15 06:01:00.000 | 209.500000000000000 | 2022-05-15 00:00:00.000 | 2022-05-15 00:01:00.000 | 234.000000000000000 | taos> explain verbose true select _wstart, first(a) as d, avg(c) from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) where a > '2022-05-15 00:01:00.000' and a < '2022-05-21 00:01:08.000' interval(5h) fill(linear) order by d desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: -> Fill (mode=linear width=32 input_order=asc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 5.row *************************** QUERY_PLAN: Time Range: [1652544060001, 1653062467999] *************************** 6.row *************************** QUERY_PLAN: -> Interval on Column a (functions=4 width=32 input_order=desc output_order=asc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 8.row *************************** QUERY_PLAN: Time Window: interval=5h offset=0a sliding=5h *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 10.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=desc ) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 14.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=desc output_order=desc) *************************** 15.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 16.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 17.row *************************** QUERY_PLAN: Filter: ((a > 1652544060000) AND (a < 1653062468000)) *************************** 18.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 19.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=desc output_order=desc) *************************** 20.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 21.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 22.row *************************** QUERY_PLAN: Merge Key: _group_id asc, desc *************************** 23.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 24.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 25.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=desc ) *************************** 26.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 27.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 28.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 29.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 30.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 31.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 32.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 33.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 34.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=desc ) *************************** 35.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 36.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 37.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 38.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 39.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 40.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, first(a) as d, avg(c) from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a asc) where a > '2022-05-15 00:01:00.000' and a < '2022-05-21 00:01:08.000' interval(5h) fill(linear) order by d desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: -> Fill (mode=linear width=32 input_order=asc ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 5.row *************************** QUERY_PLAN: Time Range: [1652544060001, 1653062467999] *************************** 6.row *************************** QUERY_PLAN: -> Interval on Column a (functions=4 width=32 input_order=asc output_order=asc ) *************************** 7.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 8.row *************************** QUERY_PLAN: Time Window: interval=5h offset=0a sliding=5h *************************** 9.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 10.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=asc ) *************************** 11.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 12.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 13.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 14.row *************************** QUERY_PLAN: -> Merge Aligned Interval on Column (functions=3 width=24 input_order=asc output_order=asc) *************************** 15.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 16.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 17.row *************************** QUERY_PLAN: Filter: ((a > 1652544060000) AND (a < 1653062468000)) *************************** 18.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 19.row *************************** QUERY_PLAN: -> SortMerge (columns=3 width=108 input_order=asc output_order=asc) *************************** 20.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 21.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 22.row *************************** QUERY_PLAN: Merge Key: _group_id asc, asc *************************** 23.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 24.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 25.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 26.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 27.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 28.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 29.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 30.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 31.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 32.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=108) *************************** 33.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 34.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=108 input_order=desc output_order=asc ) *************************** 35.row *************************** QUERY_PLAN: Output: columns=3 width=108 *************************** 36.row *************************** QUERY_PLAN: Time Window: interval=10s offset=0a sliding=10s *************************** 37.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 38.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 39.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 40.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select * from (select ts as a, c2 as b from meters order by c2 desc)\G; *************************** 1.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 2.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 3.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 4.row *************************** QUERY_PLAN: Merge Key: b desc *************************** 5.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 6.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 7.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=2 width=12) *************************** 8.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 9.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 10.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 11.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 12.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=2 width=12) *************************** 15.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 16.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 17.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 18.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> select * from (select ts as a, c2 as b from meters order by c2 desc); a | b | ======================================== 2022-05-19 00:01:08.000 | 243 | 2022-05-19 00:01:08.000 | 243 | 2022-05-15 00:01:08.000 | 234 | 2022-05-15 00:01:08.000 | 234 | 2022-05-24 00:01:08.000 | 210 | 2022-05-24 00:01:08.000 | 210 | 2022-05-22 00:01:08.000 | 196 | 2022-05-22 00:01:08.000 | 196 | 2022-05-16 00:01:08.000 | 136 | 2022-05-16 00:01:08.000 | 136 | 2022-05-20 00:01:08.000 | 120 | 2022-05-20 00:01:08.000 | 120 | 2022-05-23 00:01:08.000 | 116 | 2022-05-23 00:01:08.000 | 116 | 2022-05-17 00:01:08.000 | 59 | 2022-05-17 00:01:08.000 | 59 | 2022-05-18 00:01:08.000 | 58 | 2022-05-18 00:01:08.000 | 58 | 2022-05-21 00:01:08.000 | 11 | 2022-05-21 00:01:08.000 | 11 | taos> explain verbose true select * from (select ts as a, c2 as b from meters order by c2 desc) order by a desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=unknown output_order=desc (columns=2 width=12) *************************** 2.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 3.row *************************** QUERY_PLAN: -> Projection (columns=2 width=12 input_order=unknown ) *************************** 4.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 5.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 6.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 7.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 8.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 9.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 10.row *************************** QUERY_PLAN: Merge Key: b desc *************************** 11.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 12.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 13.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=2 width=12) *************************** 14.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 15.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 19.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 20.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=unknown (columns=2 width=12) *************************** 21.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 22.row *************************** QUERY_PLAN: -> Table Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 23.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 24.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> select * from (select ts as a, c2 as b from meters order by c2 desc) order by a desc; a | b | ======================================== 2022-05-24 00:01:08.000 | 210 | 2022-05-24 00:01:08.000 | 210 | 2022-05-23 00:01:08.000 | 116 | 2022-05-23 00:01:08.000 | 116 | 2022-05-22 00:01:08.000 | 196 | 2022-05-22 00:01:08.000 | 196 | 2022-05-21 00:01:08.000 | 11 | 2022-05-21 00:01:08.000 | 11 | 2022-05-20 00:01:08.000 | 120 | 2022-05-20 00:01:08.000 | 120 | 2022-05-19 00:01:08.000 | 243 | 2022-05-19 00:01:08.000 | 243 | 2022-05-18 00:01:08.000 | 58 | 2022-05-18 00:01:08.000 | 58 | 2022-05-17 00:01:08.000 | 59 | 2022-05-17 00:01:08.000 | 59 | 2022-05-16 00:01:08.000 | 136 | 2022-05-16 00:01:08.000 | 136 | 2022-05-15 00:01:08.000 | 234 | 2022-05-15 00:01:08.000 | 234 | taos> explain verbose true select a.ts, a.c2, b.c2 from meters as a join meters as b on a.ts = b.ts\G; *************************** 1.row *************************** QUERY_PLAN: -> Projection (columns=3 width=16 input_order=unknown ) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=16 *************************** 3.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 4.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 5.row *************************** QUERY_PLAN: -> Inner join (columns=4 width=24 input_order=asc ) *************************** 6.row *************************** QUERY_PLAN: Output: columns=4 width=24 *************************** 7.row *************************** QUERY_PLAN: Join Cond: (`test`.`a`.`ts` = `test`.`b`.`ts`) *************************** 8.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 9.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 10.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 11.row *************************** QUERY_PLAN: Merge Key: ts asc *************************** 12.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 15.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 16.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 17.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 18.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 19.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 20.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 21.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 22.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 23.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 24.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 25.row *************************** QUERY_PLAN: Merge Key: ts asc *************************** 26.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 29.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 30.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 31.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 32.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 33.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 34.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 35.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select a.ts, a.c2, b.c2 from meters as a join meters as b on a.ts = b.ts order by a.ts\G; *************************** 1.row *************************** QUERY_PLAN: -> Projection (columns=3 width=16 input_order=unknown ) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=16 *************************** 3.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 4.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 5.row *************************** QUERY_PLAN: -> Inner join (columns=4 width=24 input_order=asc ) *************************** 6.row *************************** QUERY_PLAN: Output: columns=4 width=24 *************************** 7.row *************************** QUERY_PLAN: Join Cond: (`test`.`a`.`ts` = `test`.`b`.`ts`) *************************** 8.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=asc output_order=asc) *************************** 9.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 10.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 11.row *************************** QUERY_PLAN: Merge Key: ts asc *************************** 12.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 15.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 16.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 17.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 18.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 19.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 20.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 21.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 22.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=asc output_order=asc) *************************** 23.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 24.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 25.row *************************** QUERY_PLAN: Merge Key: ts asc *************************** 26.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 29.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 30.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 31.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 32.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 33.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 34.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 35.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> select a.ts, a.c2, b.c2 from meters as a join meters as b on a.ts = b.ts; ts | c2 | c2 | ====================================================== 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-24 00:01:08.000 | 210 | 210 | 2022-05-24 00:01:08.000 | 210 | 210 | 2022-05-24 00:01:08.000 | 210 | 210 | 2022-05-24 00:01:08.000 | 210 | 210 | taos> select a.ts, a.c2, b.c2 from meters as a join meters as b on a.ts = b.ts order by a.ts desc; ts | c2 | c2 | ====================================================== 2022-05-24 00:01:08.000 | 210 | 210 | 2022-05-24 00:01:08.000 | 210 | 210 | 2022-05-24 00:01:08.000 | 210 | 210 | 2022-05-24 00:01:08.000 | 210 | 210 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-15 00:01:08.000 | 234 | 234 | taos> explain verbose true select a.ts, a.c2, b.c2 from meters as a join (select ts, c2 from meters order by ts desc) b on a.ts = b.ts order by a.ts desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Projection (columns=3 width=16 input_order=unknown ) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=16 *************************** 3.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 4.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 5.row *************************** QUERY_PLAN: -> Inner join (columns=4 width=24 input_order=desc ) *************************** 6.row *************************** QUERY_PLAN: Output: columns=4 width=24 *************************** 7.row *************************** QUERY_PLAN: Join Cond: (`test`.`a`.`ts` = `b`.`ts`) *************************** 8.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=desc output_order=desc) *************************** 9.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 10.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 11.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts desc *************************** 12.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 15.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 16.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 17.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 18.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 19.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 20.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 21.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 22.row *************************** QUERY_PLAN: -> Projection (columns=2 width=12 input_order=desc ) *************************** 23.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 24.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 25.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 26.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=desc output_order=desc) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 29.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts desc *************************** 30.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 31.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 32.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 33.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 34.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 35.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 36.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 37.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|0 desc|1]) *************************** 38.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 39.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select a.ts, a.c2, b.c2 from meters as a join (select ts, c2 from meters order by ts desc) b on a.ts = b.ts order by a.ts asc\G; *************************** 1.row *************************** QUERY_PLAN: -> Projection (columns=3 width=16 input_order=unknown ) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=16 *************************** 3.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 4.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 5.row *************************** QUERY_PLAN: -> Inner join (columns=4 width=24 input_order=asc ) *************************** 6.row *************************** QUERY_PLAN: Output: columns=4 width=24 *************************** 7.row *************************** QUERY_PLAN: Join Cond: (`test`.`a`.`ts` = `b`.`ts`) *************************** 8.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=asc output_order=asc) *************************** 9.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 10.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 11.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 12.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 15.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 16.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 17.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 18.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 19.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 20.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 21.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 22.row *************************** QUERY_PLAN: -> Projection (columns=2 width=12 input_order=asc ) *************************** 23.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 24.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 25.row *************************** QUERY_PLAN: Merge ResBlocks: False *************************** 26.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=asc output_order=asc) *************************** 27.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 28.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 29.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 30.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 31.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 32.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 33.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 34.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 35.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 36.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 37.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 38.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 39.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> select a.ts, a.c2, b.c2 from meters as a join (select * from meters order by ts desc) b on a.ts = b.ts order by a.ts asc; ts | c2 | c2 | ====================================================== 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-15 00:01:08.000 | 234 | 234 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-16 00:01:08.000 | 136 | 136 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-17 00:01:08.000 | 59 | 59 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-18 00:01:08.000 | 58 | 58 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-19 00:01:08.000 | 243 | 243 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-20 00:01:08.000 | 120 | 120 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-21 00:01:08.000 | 11 | 11 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-22 00:01:08.000 | 196 | 196 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-23 00:01:08.000 | 116 | 116 | 2022-05-24 00:01:08.000 | 210 | 210 | 2022-05-24 00:01:08.000 | 210 | 210 | 2022-05-24 00:01:08.000 | 210 | 210 | 2022-05-24 00:01:08.000 | 210 | 210 | taos> select ts, c2 from meters order by c2; ts | c2 | ======================================== 2022-05-21 00:01:08.000 | 11 | 2022-05-21 00:01:08.000 | 11 | 2022-05-18 00:01:08.000 | 58 | 2022-05-18 00:01:08.000 | 58 | 2022-05-17 00:01:08.000 | 59 | 2022-05-17 00:01:08.000 | 59 | 2022-05-23 00:01:08.000 | 116 | 2022-05-23 00:01:08.000 | 116 | 2022-05-20 00:01:08.000 | 120 | 2022-05-20 00:01:08.000 | 120 | 2022-05-16 00:01:08.000 | 136 | 2022-05-16 00:01:08.000 | 136 | 2022-05-22 00:01:08.000 | 196 | 2022-05-22 00:01:08.000 | 196 | 2022-05-24 00:01:08.000 | 210 | 2022-05-24 00:01:08.000 | 210 | 2022-05-15 00:01:08.000 | 234 | 2022-05-15 00:01:08.000 | 234 | 2022-05-19 00:01:08.000 | 243 | 2022-05-19 00:01:08.000 | 243 | taos> select ts, c2 from meters order by c2 limit 4; ts | c2 | ======================================== 2022-05-21 00:01:08.000 | 11 | 2022-05-21 00:01:08.000 | 11 | 2022-05-18 00:01:08.000 | 58 | 2022-05-18 00:01:08.000 | 58 | taos> select ts, c2 from meters order by c2 limit 2,2; ts | c2 | ======================================== 2022-05-18 00:01:08.000 | 58 | 2022-05-18 00:01:08.000 | 58 | taos> select ts, c2 from meters order by ts asc, c2 desc limit 10; ts | c2 | ======================================== 2022-05-15 00:01:08.000 | 234 | 2022-05-15 00:01:08.000 | 234 | 2022-05-16 00:01:08.000 | 136 | 2022-05-16 00:01:08.000 | 136 | 2022-05-17 00:01:08.000 | 59 | 2022-05-17 00:01:08.000 | 59 | 2022-05-18 00:01:08.000 | 58 | 2022-05-18 00:01:08.000 | 58 | 2022-05-19 00:01:08.000 | 243 | 2022-05-19 00:01:08.000 | 243 | taos> select ts, c2 from meters order by ts asc, c2 desc limit 5,5; ts | c2 | ======================================== 2022-05-17 00:01:08.000 | 59 | 2022-05-18 00:01:08.000 | 58 | 2022-05-18 00:01:08.000 | 58 | 2022-05-19 00:01:08.000 | 243 | 2022-05-19 00:01:08.000 | 243 | taos> select ts, c2 from d1 order by c2; ts | c2 | ======================================== 2022-05-21 00:01:08.000 | 11 | 2022-05-18 00:01:08.000 | 58 | 2022-05-17 00:01:08.000 | 59 | 2022-05-23 00:01:08.000 | 116 | 2022-05-20 00:01:08.000 | 120 | 2022-05-16 00:01:08.000 | 136 | 2022-05-22 00:01:08.000 | 196 | 2022-05-24 00:01:08.000 | 210 | 2022-05-15 00:01:08.000 | 234 | 2022-05-19 00:01:08.000 | 243 | taos> select ts, c2 from d1 order by c2 limit 4; ts | c2 | ======================================== 2022-05-21 00:01:08.000 | 11 | 2022-05-18 00:01:08.000 | 58 | 2022-05-17 00:01:08.000 | 59 | 2022-05-23 00:01:08.000 | 116 | taos> select ts, c2 from d1 order by c2 limit 2,2; ts | c2 | ======================================== 2022-05-17 00:01:08.000 | 59 | 2022-05-23 00:01:08.000 | 116 | taos> select ts, c2 from d1 order by ts asc, c2 desc limit 10; ts | c2 | ======================================== 2022-05-15 00:01:08.000 | 234 | 2022-05-16 00:01:08.000 | 136 | 2022-05-17 00:01:08.000 | 59 | 2022-05-18 00:01:08.000 | 58 | 2022-05-19 00:01:08.000 | 243 | 2022-05-20 00:01:08.000 | 120 | 2022-05-21 00:01:08.000 | 11 | 2022-05-22 00:01:08.000 | 196 | 2022-05-23 00:01:08.000 | 116 | 2022-05-24 00:01:08.000 | 210 | taos> select ts, c2 from d1 order by ts asc, c2 desc limit 5,5; ts | c2 | ======================================== 2022-05-20 00:01:08.000 | 120 | 2022-05-21 00:01:08.000 | 11 | 2022-05-22 00:01:08.000 | 196 | 2022-05-23 00:01:08.000 | 116 | 2022-05-24 00:01:08.000 | 210 | taos> select _wstart, first(a) as d, avg(c) from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) where a > '2022-05-15 00:01:00.000' and a < '2022-05-21 00:01:08.000' interval(5h) fill(linear) order by avg(c) desc; _wstart | d | avg(c) | ================================================================================ 2022-05-18 23:00:00.000 | 2022-05-19 00:01:00.000 | 243.000000000000000 | 2022-05-15 00:00:00.000 | 2022-05-15 00:01:00.000 | 234.000000000000000 | 2022-05-19 04:00:00.000 | 2022-05-19 04:49:00.000 | 218.400000000000006 | 2022-05-15 05:00:00.000 | 2022-05-15 06:01:00.000 | 209.500000000000000 | 2022-05-18 18:00:00.000 | 2022-05-18 19:13:00.000 | 206.000000000000000 | 2022-05-19 09:00:00.000 | 2022-05-19 09:37:00.000 | 193.800000000000011 | 2022-05-15 10:00:00.000 | 2022-05-15 12:01:00.000 | 185.000000000000000 | 2022-05-19 14:00:00.000 | 2022-05-19 14:25:00.000 | 169.199999999999989 | 2022-05-18 13:00:00.000 | 2022-05-18 14:25:00.000 | 169.000000000000000 | 2022-05-15 15:00:00.000 | 2022-05-15 18:01:00.000 | 160.500000000000000 | 2022-05-19 19:00:00.000 | 2022-05-19 19:13:00.000 | 144.599999999999994 | 2022-05-15 20:00:00.000 | 2022-05-16 00:01:00.000 | 136.000000000000000 | 2022-05-18 08:00:00.000 | 2022-05-18 09:37:00.000 | 132.000000000000000 | 2022-05-16 01:00:00.000 | 2022-05-16 04:49:00.000 | 120.599999999999994 | 2022-05-20 00:00:00.000 | 2022-05-20 00:01:00.000 | 120.000000000000000 | 2022-05-16 06:00:00.000 | 2022-05-16 09:37:00.000 | 105.200000000000003 | 2022-05-18 03:00:00.000 | 2022-05-18 04:49:00.000 | 95.000000000000000 | 2022-05-20 05:00:00.000 | 2022-05-20 06:01:00.000 | 92.750000000000000 | 2022-05-16 11:00:00.000 | 2022-05-16 14:25:00.000 | 89.799999999999997 | 2022-05-16 16:00:00.000 | 2022-05-16 19:13:00.000 | 74.400000000000006 | 2022-05-20 10:00:00.000 | 2022-05-20 12:01:00.000 | 65.500000000000000 | 2022-05-16 21:00:00.000 | 2022-05-17 00:01:00.000 | 59.000000000000000 | 2022-05-17 02:00:00.000 | 2022-05-17 04:49:00.000 | 58.799999999999997 | 2022-05-17 07:00:00.000 | 2022-05-17 09:37:00.000 | 58.600000000000001 | 2022-05-17 12:00:00.000 | 2022-05-17 14:25:00.000 | 58.399999999999999 | 2022-05-17 17:00:00.000 | 2022-05-17 19:13:00.000 | 58.200000000000003 | 2022-05-17 22:00:00.000 | 2022-05-18 00:01:00.000 | 58.000000000000000 | 2022-05-20 15:00:00.000 | 2022-05-20 18:01:00.000 | 38.250000000000000 | 2022-05-20 20:00:00.000 | 2022-05-21 00:01:00.000 | 11.000000000000000 | taos> select _wstart, first(a) as d, avg(c) from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) where a > '2022-05-15 00:01:00.000' and a < '2022-05-21 00:01:08.000' interval(5h) fill(linear) order by avg(c) desc limit 2; _wstart | d | avg(c) | ================================================================================ 2022-05-18 23:00:00.000 | 2022-05-19 00:01:00.000 | 243.000000000000000 | 2022-05-15 00:00:00.000 | 2022-05-15 00:01:00.000 | 234.000000000000000 | taos> select _wstart, first(a) as d, avg(c) from (select _wstart as a, last(ts) as b, avg(c2) as c from meters interval(10s) order by a desc) where a > '2022-05-15 00:01:00.000' and a < '2022-05-21 00:01:08.000' interval(5h) fill(linear) order by avg(c) desc limit 2,6; _wstart | d | avg(c) | ================================================================================ 2022-05-19 04:00:00.000 | 2022-05-19 04:49:00.000 | 218.400000000000006 | 2022-05-15 05:00:00.000 | 2022-05-15 06:01:00.000 | 209.500000000000000 | 2022-05-18 18:00:00.000 | 2022-05-18 19:13:00.000 | 206.000000000000000 | 2022-05-19 09:00:00.000 | 2022-05-19 09:37:00.000 | 193.800000000000011 | 2022-05-15 10:00:00.000 | 2022-05-15 12:01:00.000 | 185.000000000000000 | 2022-05-19 14:00:00.000 | 2022-05-19 14:25:00.000 | 169.199999999999989 | taos> select last(ts), c2 as d from d1 group by c2 order by c2 desc limit 10; last(ts) | d | ======================================== 2022-05-19 00:01:08.000 | 243 | 2022-05-15 00:01:08.000 | 234 | 2022-05-24 00:01:08.000 | 210 | 2022-05-22 00:01:08.000 | 196 | 2022-05-16 00:01:08.000 | 136 | 2022-05-20 00:01:08.000 | 120 | 2022-05-23 00:01:08.000 | 116 | 2022-05-17 00:01:08.000 | 59 | 2022-05-18 00:01:08.000 | 58 | 2022-05-21 00:01:08.000 | 11 | taos> select last(ts), c2 as d from d1 group by c2 order by c2 desc limit 2,8; last(ts) | d | ======================================== 2022-05-24 00:01:08.000 | 210 | 2022-05-22 00:01:08.000 | 196 | 2022-05-16 00:01:08.000 | 136 | 2022-05-20 00:01:08.000 | 120 | 2022-05-23 00:01:08.000 | 116 | 2022-05-17 00:01:08.000 | 59 | 2022-05-18 00:01:08.000 | 58 | 2022-05-21 00:01:08.000 | 11 | taos> select last(ts), c2 as d from d1 group by c2 order by c2 desc limit 9,1; last(ts) | d | ======================================== 2022-05-21 00:01:08.000 | 11 | taos> select last(ts), c2 as d from d1 group by c2 order by c2 asc limit 2,8; last(ts) | d | ======================================== 2022-05-17 00:01:08.000 | 59 | 2022-05-23 00:01:08.000 | 116 | 2022-05-20 00:01:08.000 | 120 | 2022-05-16 00:01:08.000 | 136 | 2022-05-22 00:01:08.000 | 196 | 2022-05-24 00:01:08.000 | 210 | 2022-05-15 00:01:08.000 | 234 | 2022-05-19 00:01:08.000 | 243 | taos> select last(ts), c2 as d from d1 group by c2 order by c2 asc limit 9,1; last(ts) | d | ======================================== 2022-05-19 00:01:08.000 | 243 | taos> select last(ts) as ts, c2 as d from d1 group by c2 order by ts desc, c2 asc limit 10; ts | d | ======================================== 2022-05-24 00:01:08.000 | 210 | 2022-05-23 00:01:08.000 | 116 | 2022-05-22 00:01:08.000 | 196 | 2022-05-21 00:01:08.000 | 11 | 2022-05-20 00:01:08.000 | 120 | 2022-05-19 00:01:08.000 | 243 | 2022-05-18 00:01:08.000 | 58 | 2022-05-17 00:01:08.000 | 59 | 2022-05-16 00:01:08.000 | 136 | 2022-05-15 00:01:08.000 | 234 | taos> select last(ts) as ts, c2 as d from d1 group by c2 order by ts desc, c2 asc limit 2,8; ts | d | ======================================== 2022-05-22 00:01:08.000 | 196 | 2022-05-21 00:01:08.000 | 11 | 2022-05-20 00:01:08.000 | 120 | 2022-05-19 00:01:08.000 | 243 | 2022-05-18 00:01:08.000 | 58 | 2022-05-17 00:01:08.000 | 59 | 2022-05-16 00:01:08.000 | 136 | 2022-05-15 00:01:08.000 | 234 | taos> select last(ts) as ts, c2 as d from d1 group by c2 order by ts desc, c2 asc limit 9,1; ts | d | ======================================== 2022-05-15 00:01:08.000 | 234 | taos> explain verbose true select _wstart, _wend, count(*) from meters event_window start with c2 > 0 end with c2 < 100\G; *************************** 1.row *************************** QUERY_PLAN: -> Event (functions=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Start Cond: (`test`.`meters`.`c2` > 0) *************************** 3.row *************************** QUERY_PLAN: End Cond: (`test`.`meters`.`c2` < 100) *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 9.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 14.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters event_window start with c2 > 0 end with c2 < 100 order by _wstart desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: -> Event (functions=3 width=24) *************************** 4.row *************************** QUERY_PLAN: Start Cond: (`test`.`meters`.`c2` > 0) *************************** 5.row *************************** QUERY_PLAN: End Cond: (`test`.`meters`.`c2` < 100) *************************** 6.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 7.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 9.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 10.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 15.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 18.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 19.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters event_window start with c2 > 0 end with c2 < 100 order by _wstart asc\G; *************************** 1.row *************************** QUERY_PLAN: -> Event (functions=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Start Cond: (`test`.`meters`.`c2` > 0) *************************** 3.row *************************** QUERY_PLAN: End Cond: (`test`.`meters`.`c2` < 100) *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 9.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 14.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters event_window start with c2 > 0 end with c2 < 100 order by _wend desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: -> Event (functions=3 width=24) *************************** 4.row *************************** QUERY_PLAN: Start Cond: (`test`.`meters`.`c2` > 0) *************************** 5.row *************************** QUERY_PLAN: End Cond: (`test`.`meters`.`c2` < 100) *************************** 6.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 7.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 9.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 10.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 15.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 18.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 19.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters event_window start with c2 > 0 end with c2 < 100 order by _wend asc\G; *************************** 1.row *************************** QUERY_PLAN: -> Event (functions=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Start Cond: (`test`.`meters`.`c2` > 0) *************************** 3.row *************************** QUERY_PLAN: End Cond: (`test`.`meters`.`c2` < 100) *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 9.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 14.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> select _wstart, _wend, count(*) from meters event_window start with c2 > 0 end with c2 < 100; _wstart | _wend | count(*) | ============================================================================ 2022-05-15 00:01:08.000 | 2022-05-17 00:01:08.000 | 5 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 1 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 1 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 1 | 2022-05-19 00:01:08.000 | 2022-05-21 00:01:08.000 | 5 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 1 | taos> select _wstart, _wend, count(*) from meters event_window start with c2 > 0 end with c2 < 100 order by _wstart desc; _wstart | _wend | count(*) | ============================================================================ 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 1 | 2022-05-19 00:01:08.000 | 2022-05-21 00:01:08.000 | 5 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 1 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 1 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 1 | 2022-05-15 00:01:08.000 | 2022-05-17 00:01:08.000 | 5 | taos> select _wstart, _wend, count(*) from meters event_window start with c2 > 0 end with c2 < 100 order by _wstart asc; _wstart | _wend | count(*) | ============================================================================ 2022-05-15 00:01:08.000 | 2022-05-17 00:01:08.000 | 5 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 1 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 1 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 1 | 2022-05-19 00:01:08.000 | 2022-05-21 00:01:08.000 | 5 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 1 | taos> select _wstart, _wend, count(*) from meters event_window start with c2 > 0 end with c2 < 100 order by _wend desc; _wstart | _wend | count(*) | ============================================================================ 2022-05-19 00:01:08.000 | 2022-05-21 00:01:08.000 | 5 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 1 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 1 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 1 | 2022-05-15 00:01:08.000 | 2022-05-17 00:01:08.000 | 5 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 1 | taos> select _wstart, _wend, count(*) from meters event_window start with c2 > 0 end with c2 < 100 order by _wend asc; _wstart | _wend | count(*) | ============================================================================ 2022-05-15 00:01:08.000 | 2022-05-17 00:01:08.000 | 5 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 1 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 1 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 1 | 2022-05-19 00:01:08.000 | 2022-05-21 00:01:08.000 | 5 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 1 | taos> explain verbose true select _wstart, _wend, count(*) from meters session(ts, 1h)\G; *************************** 1.row *************************** QUERY_PLAN: -> Session (functions=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Window: gap=3600000 *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=1 width=8 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 9.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 14.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wstart desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: -> Session (functions=3 width=24) *************************** 4.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 5.row *************************** QUERY_PLAN: Window: gap=3600000 *************************** 6.row *************************** QUERY_PLAN: -> SortMerge (columns=1 width=8 input_order=unknown output_order=unknown) *************************** 7.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 9.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 10.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 11.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 12.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 13.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 14.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 15.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 16.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 17.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 18.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 19.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wstart asc\G; *************************** 1.row *************************** QUERY_PLAN: -> Session (functions=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Window: gap=3600000 *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=1 width=8 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 9.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 14.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wend desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: -> Session (functions=3 width=24) *************************** 4.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 5.row *************************** QUERY_PLAN: Window: gap=3600000 *************************** 6.row *************************** QUERY_PLAN: -> SortMerge (columns=1 width=8 input_order=unknown output_order=unknown) *************************** 7.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 9.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 10.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 11.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 12.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 13.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 14.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 15.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 16.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 17.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 18.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 19.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wend asc\G; *************************** 1.row *************************** QUERY_PLAN: -> Session (functions=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Window: gap=3600000 *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=1 width=8 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 9.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 14.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> select _wstart, _wend, count(*) from meters session(ts, 1h); _wstart | _wend | count(*) | ============================================================================ 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | taos> select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wstart desc; _wstart | _wend | count(*) | ============================================================================ 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | taos> select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wstart asc; _wstart | _wend | count(*) | ============================================================================ 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | taos> select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wend desc; _wstart | _wend | count(*) | ============================================================================ 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | taos> select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wend asc; _wstart | _wend | count(*) | ============================================================================ 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | taos> explain verbose true select _wstart, _wend, count(*) from meters session(ts, 1h)\G; *************************** 1.row *************************** QUERY_PLAN: -> Session (functions=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Window: gap=3600000 *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=1 width=8 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 9.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 14.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wstart desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: -> Session (functions=3 width=24) *************************** 4.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 5.row *************************** QUERY_PLAN: Window: gap=3600000 *************************** 6.row *************************** QUERY_PLAN: -> SortMerge (columns=1 width=8 input_order=unknown output_order=unknown) *************************** 7.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 9.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 10.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 11.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 12.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 13.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 14.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 15.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 16.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 17.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 18.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 19.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wstart asc\G; *************************** 1.row *************************** QUERY_PLAN: -> Session (functions=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Window: gap=3600000 *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=1 width=8 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 9.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 14.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wend desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: -> Session (functions=3 width=24) *************************** 4.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 5.row *************************** QUERY_PLAN: Window: gap=3600000 *************************** 6.row *************************** QUERY_PLAN: -> SortMerge (columns=1 width=8 input_order=unknown output_order=unknown) *************************** 7.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 9.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 10.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 11.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 12.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 13.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 14.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 15.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 16.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 17.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 18.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 19.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wend asc\G; *************************** 1.row *************************** QUERY_PLAN: -> Session (functions=3 width=24) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Window: gap=3600000 *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=1 width=8 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 9.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=8) *************************** 14.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=1 width=8 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=1 width=8 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> select _wstart, _wend, count(*) from meters session(ts, 1h); _wstart | _wend | count(*) | ============================================================================ 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | taos> select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wstart desc; _wstart | _wend | count(*) | ============================================================================ 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | taos> select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wstart asc; _wstart | _wend | count(*) | ============================================================================ 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | taos> select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wend desc; _wstart | _wend | count(*) | ============================================================================ 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | taos> select _wstart, _wend, count(*) from meters session(ts, 1h) order by _wend asc; _wstart | _wend | count(*) | ============================================================================ 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | taos> explain verbose true select _wstart, _wend, count(*), last(ts) from meters state_window(c2)\G; *************************** 1.row *************************** QUERY_PLAN: -> StateWindow on Column c2 (functions=4 width=36) *************************** 2.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 3.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 9.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 14.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*), last(ts) from meters state_window(c2) order by _wstart desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=4 width=32) *************************** 2.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 3.row *************************** QUERY_PLAN: -> StateWindow on Column c2 (functions=4 width=36) *************************** 4.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 5.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 6.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 7.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 9.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 10.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 15.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 18.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 19.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*), last(ts) from meters state_window(c2) order by _wstart asc\G; *************************** 1.row *************************** QUERY_PLAN: -> StateWindow on Column c2 (functions=4 width=36) *************************** 2.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 3.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 9.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 14.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*), last(ts) from meters state_window(c2) order by _wend desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=4 width=32) *************************** 2.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 3.row *************************** QUERY_PLAN: -> StateWindow on Column c2 (functions=4 width=36) *************************** 4.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 5.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 6.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 7.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 9.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 10.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 15.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 18.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 19.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, count(*), last(ts) from meters state_window(c2) order by _wend asc\G; *************************** 1.row *************************** QUERY_PLAN: -> StateWindow on Column c2 (functions=4 width=36) *************************** 2.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 3.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 4.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 5.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 6.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 7.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 8.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 9.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 10.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 13.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 14.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 15.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> select _wstart, _wend, count(*), last(ts) from meters state_window(c2); _wstart | _wend | count(*) | last(ts) | ====================================================================================================== 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-15 00:01:08.000 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | taos> select _wstart, _wend, count(*), last(ts) from meters state_window(c2) order by _wstart desc; _wstart | _wend | count(*) | last(ts) | ====================================================================================================== 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-15 00:01:08.000 | taos> select _wstart, _wend, count(*), last(ts) from meters state_window(c2) order by _wstart asc; _wstart | _wend | count(*) | last(ts) | ====================================================================================================== 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-15 00:01:08.000 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | taos> select _wstart, _wend, count(*), last(ts) from meters state_window(c2) order by _wend desc; _wstart | _wend | count(*) | last(ts) | ====================================================================================================== 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-15 00:01:08.000 | taos> select _wstart, _wend, count(*), last(ts) from meters state_window(c2) order by _wend asc; _wstart | _wend | count(*) | last(ts) | ====================================================================================================== 2022-05-15 00:01:08.000 | 2022-05-15 00:01:08.000 | 2 | 2022-05-15 00:01:08.000 | 2022-05-16 00:01:08.000 | 2022-05-16 00:01:08.000 | 2 | 2022-05-16 00:01:08.000 | 2022-05-17 00:01:08.000 | 2022-05-17 00:01:08.000 | 2 | 2022-05-17 00:01:08.000 | 2022-05-18 00:01:08.000 | 2022-05-18 00:01:08.000 | 2 | 2022-05-18 00:01:08.000 | 2022-05-19 00:01:08.000 | 2022-05-19 00:01:08.000 | 2 | 2022-05-19 00:01:08.000 | 2022-05-20 00:01:08.000 | 2022-05-20 00:01:08.000 | 2 | 2022-05-20 00:01:08.000 | 2022-05-21 00:01:08.000 | 2022-05-21 00:01:08.000 | 2 | 2022-05-21 00:01:08.000 | 2022-05-22 00:01:08.000 | 2022-05-22 00:01:08.000 | 2 | 2022-05-22 00:01:08.000 | 2022-05-23 00:01:08.000 | 2022-05-23 00:01:08.000 | 2 | 2022-05-23 00:01:08.000 | 2022-05-24 00:01:08.000 | 2022-05-24 00:01:08.000 | 2 | 2022-05-24 00:01:08.000 | taos> explain verbose true select _wstart, _wend, count(*), last(ts) from meters state_window(c2) order by _wend asc, count(*) desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=asc (columns=4 width=32) *************************** 2.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 3.row *************************** QUERY_PLAN: -> StateWindow on Column c2 (functions=5 width=44) *************************** 4.row *************************** QUERY_PLAN: Output: columns=5 width=40 *************************** 5.row *************************** QUERY_PLAN: Output: columns=5 width=40 *************************** 6.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 7.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 8.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 9.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 10.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 11.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 12.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 15.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 16.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 17.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 18.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 19.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, last(ts) from (select _wstart as ts, _wend, count(*), last(ts) from meters state_window(c2) order by _wend desc) interval(1h) order by _wstart desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=24 input_order=desc output_order=desc ) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Time Window: interval=1h offset=0a sliding=1h *************************** 4.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 5.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=desc ) *************************** 6.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 7.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 8.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 9.row *************************** QUERY_PLAN: -> Sort input_order=asc output_order=desc (columns=3 width=24) *************************** 10.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 11.row *************************** QUERY_PLAN: -> StateWindow on Column c2 (functions=4 width=36) *************************** 12.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 13.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 14.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 15.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 16.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 17.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 18.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 19.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 20.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 21.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 22.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 23.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 24.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 25.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 26.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 27.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] taos> explain verbose true select _wstart, _wend, last(ts) from (select _wstart as ts, _wend, count(*), last(ts) from meters state_window(c2) order by _wend asc) interval(1h) order by _wstart desc\G; *************************** 1.row *************************** QUERY_PLAN: -> Interval on Column ts (functions=3 width=24 input_order=asc output_order=desc ) *************************** 2.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 3.row *************************** QUERY_PLAN: Time Window: interval=1h offset=0a sliding=1h *************************** 4.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 5.row *************************** QUERY_PLAN: -> Projection (columns=3 width=24 input_order=asc ) *************************** 6.row *************************** QUERY_PLAN: Output: columns=3 width=24 *************************** 7.row *************************** QUERY_PLAN: Output: Ignore Group Id: true *************************** 8.row *************************** QUERY_PLAN: Merge ResBlocks: True *************************** 9.row *************************** QUERY_PLAN: -> StateWindow on Column c2 (functions=4 width=36) *************************** 10.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 11.row *************************** QUERY_PLAN: Output: columns=4 width=32 *************************** 12.row *************************** QUERY_PLAN: -> SortMerge (columns=2 width=12 input_order=unknown output_order=unknown) *************************** 13.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 14.row *************************** QUERY_PLAN: Output: Ignore Group Id: false *************************** 15.row *************************** QUERY_PLAN: Merge Key: _group_id asc, ts asc *************************** 16.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 17.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 18.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 19.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 20.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807] *************************** 21.row *************************** QUERY_PLAN: -> Data Exchange 1:1 (width=12) *************************** 22.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 23.row *************************** QUERY_PLAN: -> Table Merge Scan on meters (columns=2 width=12 order=[asc|1 desc|0]) *************************** 24.row *************************** QUERY_PLAN: Output: columns=2 width=12 *************************** 25.row *************************** QUERY_PLAN: Time Range: [-9223372036854775808, 9223372036854775807]