On Wed, Sep 21, 2016 at 8:14 AM, <ikovalyo...@gmail.com> wrote:

> Hi.
> I would like to solve following issue:
> I have data coming in to the system with some delays. So when CQ runs some
> data is missing. So I want to resample it.
>
> #1 runs every minute. I want to go back in time by 30 minutes
> CREATE CONTINUOUS QUERY MINUTE ON db RESAMPLE FOR 30m
> begin
>    select ... into ... from ... where ... group by ..., time(1m)
> end
>
> right?
>

That CQ will run every minute, over the previous 30 minutes of data (by
timestamp).


>
> #2 runs every hour. I want to recalculate it 30 minutes later. This one
> sounds very tricky for me and I'm not sure how to do it correctly.
>
> CREATE CONTINUOUS QUERY MINUTE ON db RESAMPLE EVERY 30m FOR 1h
> begin
>    select ... into ... from ... where ... group by ..., time(1h)
> end
>

That CQ will run every 30 minutes over the previous hour, but the hour
buckets will fall on 00 minute boundaries that contain. E.g.

At 0300, the CQ that runs will be
SELECT ... INTO ... FROM ...WHERE time > 0200 and time < 0300 GROUP BY
time(1h)
At 0330, the CQ that runs will be
SELECT ... INTO ... FROM ...WHERE time > *0300* and time < *0400* GROUP BY
time(1h)
At 0400, the CQ that runs will again be
SELECT ... INTO ... FROM ...WHERE time > 0300 and time < 0400 GROUP BY
time(1h)
At 0430, the CQ that runs will be
SELECT ... INTO ... FROM ...WHERE time > *0400* and time < *0500* GROUP BY
time(1h)

It sounds like your data might be up to 30 minutes old, so to be safe, I'd
also use a RESAMPLE FOR 2h.

Then at 0300, the CQ that runs will be
SELECT ... INTO ... FROM ...WHERE time > 0100 and time < 0300 GROUP BY
time(1h)
At 0330, the CQ that runs will be
SELECT ... INTO ... FROM ...WHERE time > *0200* and time < *0400* GROUP BY
time(1h)
At 0400, the CQ that runs will again be
SELECT ... INTO ... FROM ...WHERE time > 0200 and time < 0400 GROUP BY
time(1h)
At 0430, the CQ that runs will be
SELECT ... INTO ... FROM ...WHERE time > *0300* and time < *0500* GROUP BY
time(1h)




>
> Or should we do it in a different way?
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to influxdb+unsubscr...@googlegroups.com.
> To post to this group, send email to influxdb@googlegroups.com.
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/influxdb/a0277b82-c588-4576-ba06-d09ac2b86910%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sean Beckett
Director of Support and Professional Services
InfluxDB

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to influxdb+unsubscr...@googlegroups.com.
To post to this group, send email to influxdb@googlegroups.com.
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALGqCvN5vF4c8i%3DbfLN%3DzWp%3DXP%3DZBPiW2ToCYHU1PUsgw6VPBA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to