I’m trying to group the data into 15 minute bars with the following query:
select first(price) AS open, last(price) AS close, max(price) AS high, min(price) AS low from ticks where symbol = 'BTCUSD' group by time(15m), symbol
This works fine and I’m getting the following result:
time open close high low
---- ---- ----- ---- ---
1551708900000000000 3736.32 3738.37 3738.37 3736.32
1551709800000000000 3738.11 3738.66 3738.66 3737.64
1551710700000000000 3736.66 3736.66 3736.67 3736.66
However, now I want to query 15 minute bars, but with an offset of +1 minute. So I want the bars to start at minute 1, 16, 31 and 46. As far as I understand I can achieve it with ‘group by time(15m,1m)’ but when I do that my query times out and never returns any records.
I have done a simple test and I have also a timeout , no results …
I guess it is a bug ?
I have found a workaround , if you add “and time > now() -3w” for example it works
I have stopped my ‘bad’ query with ctrl-c and that shows that the query starts from 5 october 1694
2 weeks before the British/American colonial forces, led by Sir William Phips, fail to seize Quebec from the French.
Ok I figured it out myself. I needed to include an additional where statement stating from which point in time I wanted to query, because otherwise it would try to fill from the beginning of time
MarkV: Yes you’re correct. It seems like a bug which causes it to fill the result set from 1694 till now. Setting a start date is a good workaround for me.