Support Continuous Query Feature #265
Replies: 2 comments 1 reply
-
CQ development plan design[TOC] preconditionIn the case of node restart or network failure, accept a certain degree of repeated execution of CQ. ParseCreateCreate continues query through ts-sqlCREATE CONTINUOUS QUERY <cq_name> ON <database_name>
RESAMPLE EVERY <interval> FOR <interval>
BEGIN
<cq_query>
END
[continuous_queries]
# concurrent exec continues queries goroutines number
max-process-CQ-number = 5
ts-meta persistence continues query taskopenGemini/open_src/influx/meta/database.go Lines 18 to 24 in 8674137 type DatabaseInfo struct {
......
ContinuousQueries []ContinuousQueriesInfo # ⭐️
} type ContinuousQueriesInfo struct {
Name string
Query string
}
additional
Rununique ID: IP:PORT SQL -> Meta heartbeat every second. Meta assigns different CQ tasks to different SQL.
Scheduling
Query task> SHOW CONTINUOUS QUERIES
name: _internal
name query
---- -----
cq_demo CREATE CONTINUOUS QUERY ...... Get CQ tasks from Meta. StopDROP CONTINUOUS QUERY <cq_name> ON <database_name>
TriggerSupport manually triggering a CQ to execute once through the curl command. MonitorConsider adding monitoring items, such as quantity, execution time, whether to report errors, etc. |
Beta Was this translation helpful? Give feedback.
-
1、The number of CQs must be limited. Number of DataNode x 100. --- what type of dataNode is, SQL or Store Node? |
Beta Was this translation helpful? Give feedback.
-
In Devops/IOT scenes when using time-series databases, qps(queries per second) for database is getting slower when data nodes grow (including numbers of data, the dimensions of the data), also, the longer the data is from now, the less accurate we require them.
Continuous Query(CQ) can provide the feature to aggregate data according to the SQL which defined by user, compare with other down-sample methods(e.g sliding-down-sample), CQ can support more SQL which are more complex and flexible, take continuous query in InfluxDB as an example:
data
create continuous query:
cq_basic_rp executes at one-hour intervals, the same interval as the GROUP BY time() interval. Every hour, cq_basic_rp runs a single query that covers the time range between now() and now() minus the GROUP BY time() interval, that is, the time range between now() and one hour prior to now().
Annotated log output on the morning of August 28, 2016:
At 8:00
cq_basic_rp
executes a query with the time rangetime >= '7:00' AND time < '8:00'
.cq_basic_rp
writes one point to thethree_weeks
RP and theaverage_passengers
measurement:At 9:00
cq_basic_rp
executes a query with the time rangetime >= '8:00' AND time < '9:00'
.cq_basic_rp
writes one point to thethree_weeks
RP and theaverage_passengers
measurement:Results:
> SELECT * FROM "transportation"."three_weeks"."average_passengers"
Beta Was this translation helpful? Give feedback.
All reactions