In General, the database has records, each record has a field dt that contains a Timestamp of the time the record was added.
id | user | data | dt
For each user record "clumps", i.e., is for example 10 records in the interval from 20 sec to 20 min, then empty all day - following again around this time. Ie the interval between the "heap" not less than 23 hours.
Need to add another column to the table - dt_start. And here it is inside each heap should be put down minimalny Timestamp from this heap.
Tell me how to do it