Maximum number of CQ to create in InfluxDB database

Dear InfluxDB Experts,

I can’t find in their documentation, is there any limit of the number of Continuous queries (CQ) for a specific database?
For example, I have “myDB” with thousands of measurements, I want to create a CQ for each
measurement. So my question is :

  1. Will it be possible to create that? The CQ is simple getting the average values and write it into another database.
  2. If this is possible, is there any way to template the CQ? As I said, the query is just getting average value for each measurement, so basically the syntax is just repeated for each measurement, will it be possible to create a CQ templates that runs on each measurements? for example:

CREATE CONTINUOUS QUERY “cq_measurement_name” on “dbname”
BEGIN
SELECT mean(“value”) INTO “db2.measurement_name” FROM “measurement_name” GROUP BY time (1m)
END

So my CQ is something like that, it is just time-consuming on my side to create thousands of queries like that, I hope there is another way to make the creation faster since the query has a pattern.

Thank you Experts!

Regards,

Hello @Henjoe_Gutierrez,
You can’t templatise CQ but you can take advantage of flux, tasks, and templates.
Transitioning to Flux from InfluxQL can feel painful, but functionally it’s quite impressive! Looking back it’s hard to imagine using InfluxQL.

InfluxDB templates | InfluxDB OSS 2.0 Documentation.