You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 8 Next »


Continuous Query is a very useful feature for users to query time series data automatically and periodically on realtime data and store query results in a specified measurement according to the time interval and time range.

For example, using the continuous query described below, the IoTDB downsamples the CPU load metric, and keeps a single average datapoint per 15 minutes grouped by server region:

CREATE CONTINUOUS QUERY "downsampled_cpu_load"
ON database_name
BEGIN
  SELECT mean(value) as value,
  INTO "downsampled.cpu_load"
  FROM cpu_load
  GROUP BY time(15m), region
END

Syntax

Basic syntax

CREATE CONTINUOUS QUERY <cq_name> ON <database_name>

BEGIN <cq_query>

END



  • No labels