Programming, Alibaba Cloud, Database, Postgresql, Data Analytics.
plan is as follows: explain (analyze,verbose,timing,costs,buffers) with recursive t as ( ( select sensor_stat as sensor_stat from sensor_stat where state is true order by sid, crt_time desc limit 1 ) union all ( select (select t1 from sensor_stat AS t1 where t1.sid>(t.sensor_stat).sid and t1.state