Programming, Alibaba Cloud, Database, Postgresql, Data Analytics.
sensors without data are not counted. Therefore, the state only needs to be reserved within 1 hour. One way to reserve is to use pipelinedb. Another way to reserve is to use two tables for polling. create table sensor_stat1 ( sid int, -- 传感器ID state boolean, -- 传感器状态，true在线，false离线 crt_time