Is there a way to generate Period
s by a condition where the value is above a certain threshold without loading all DbValue
s in memory?
So when I have the following DbValues in my database:
TimeStamp | NumericValue
-------- | -------- | --------
2023-04-01 02:00:00.000 | 8
2023-04-01 02:00:01.000 | 3
2023-04-01 02:00:02.000 | 4
2023-04-01 02:00:03.000 | 6
2023-04-01 02:00:04.000 | 3
2023-04-01 02:00:05.000 | 2
2023-04-01 02:00:06.000 | 9
And I query for NumericValue
less than 5 I want to get two instances of Period
, one with StartDate=2023-04-01 02:00:01.000
and EndDate=2023-04-01 02:00:02.000
and one with StartDate=2023-04-01 02:00:04.000
and EndDate=2023-04-01 02:00:05.000
but without loading all DbValue
s from the database in memory.