Thanks for your suggestion. I will just write more about my motivation for asking the question.
When I asked the question, I wanted to use CQ to downsample all my data with multiple precision level, like 1m -> 5m -> 20m -> 1h.
CREATE CONTINUOUS QUERY "downsample" ON "telegraf"
RESAMPLE EVERY 5m FOR 10m
SELECT mean(*) INTO "telegraf"."5m_sample".:MEASUREMENT FROM /.*/ GROUP BY time(5m), *
Multiple precision level means multiple prefix to the fieldname, which makes it more complicated for our API provider to auto choose the appropriate rp or db based on the query duration.
So I thought that will be great it I can solve the problem with 3~4 CQs. And I was too lazy to write the CQ management script to generate CQs for all measurement, Hoping to find a statement to do it for me, which the reason that I ask the question.
And now I find some performance issue with the regular_expression_measurement in the into clause, every time I execute something like “SELECT mean() INTO “telegraf”.“5m_sample”.:MEASUREMENT FROM /./ where time >= <start_time> and time < <end_time> GROUP BY time(5m), *”, It will stuck like, forever. (offline, about 900 measurement, 100,000 series in that time range I guess)
Finally, without the ability to duplicate the online work load and dig into it, I decide to write CQ management script. Wish me good luck.