I have a table with the following structure:
timstamp-start, timestamp-stop 1,5 6,10 25,30 31,35 ...
I am only interested in continuous timespans e.g. the break between a timestamp-end and the following timestamp-start is less than 3.
How could I get the aggregated covered timespans as a result:
timestamp-start,timestamp-stop 1,10 25,35
The reason I am considering this is because a user may request a time span that would need to return several thousand rows. However, most records are continuous and using above method could potentially reduce many thousand of rows down to just a dozen. Or is the added computation not worth the savings in bandwidth and latency?
For example: if the values are 1,5 and 7,10, I don't want 2 rows because 5 and 7 are less than three apart so I want them to be combined into one row (1,10)