Outside range data

Hi, I store on Influx the changes of a signal so in my data I can find something like this:

_time, -value, signal
2023-08-09T10:47:51.953Z, true, status
2023-08-11T10:47:51.953Z, false, status
2023-08-12T10:47:51.953Z, true, status

Of those signals, I would like to calculate the amount of time that they have been up.
The problem comes when the first value in the range is false because I don’t know when it became true. So to solve this problem I make a range to look back in the past (start: realStart - 1mo, stop: realtStart), sort desc the results by _time, pick the first element, and union the results with the right range.
This solution has worked for a while but now a signal that has been up for more than a month went down so when I look back in time using the previous logic I cannot find it anymore.
I thought that increasing the look-back time from 1mo to 1y would bring again the value to the results but the query takes really a lot of time to execute and the problem is still there because if a signal stays up for more than a year I will not find anymore.

Has anyone encountered a similar problem? How did you solve it?

Hello @Darkenblot,
This is actually a long time problem.
Finding global values is hard.
Luckily the rewrite of the storage engine in 3.x solves this problem.
Unfortunately the OSS version isn’t available yet.

You’re doing the right thing though. You could try 6mo instead of year, but yah this is a long time issue/feature request.

Ok then for now I’ll increment to 6mo. Do you know if the OSS release has been already planned? There will be some compatibility problems between 2.x and 3.x?