Reliability is the core of PagerDuty. A critical failure point in incident management is the "coverage gap"—a period where one engineer has finished their shift, but the next engineer has not yet started.
Write a query to find all instances where there was a gap of more than 5 minutes between two consecutive shifts in the same schedule.
| shift_id(INTEGER) | schedule_id(INTEGER) | user_id(INTEGER) | start_time(TIMESTAMP) | end_time(TIMESTAMP) |
|---|---|---|---|---|
| 1 | 501 | 10 | 2024-03-01 00:00:00 | 2024-03-01 08:00:00 |
| 2 | 501 | 11 | 2024-03-01 08:06:00 | 2024-03-01 16:00:00 |
| 3 | 501 | 12 | 2024-03-01 16:02:00 | 2024-03-02 00:00:00 |
| 4 | 502 | 20 | 2024-03-01 00:00:00 | 2024-03-01 12:00:00 |
| 5 | 502 | 21 | 2024-03-01 12:15:00 | 2024-03-02 00:00:00 |
| 6 | 503 | 30 | 2024-03-01 00:00:00 | 2024-03-01 08:00:00 |
| schedule_id(INTEGER) | shift_end(TIMESTAMP) | next_shift_start(TIMESTAMP) | gap_duration_minutes(INTEGER) |
|---|---|---|---|
| 501 | 2024-03-01 08:00:00 | 2024-03-01 08:06:00 | 6 |
| 502 | 2024-03-01 12:00:00 | 2024-03-01 12:15:00 | 15 |