add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
Help with an interesting Postgres question: Why isn't an Index Only Scan used on a partition accessed via the parent table?.
CREATE TABLE
INSERT 0 2
CREATE TABLE
INSERT 0 8
id start_time end_time
1 2023-10-27 12:00:00 2023-10-28 00:00:00
1 2023-10-28 00:00:00 2023-10-29 00:00:00
1 2023-10-29 00:00:00 2023-10-30 00:00:00
1 2023-10-30 00:00:00 2023-10-31 00:00:00
1 2023-10-31 00:00:00 2023-10-31 12:00:00
2 2023-10-30 12:15:00 2023-10-31 00:00:00
2 2023-10-31 00:00:00 2023-11-01 00:00:00
2 2023-11-01 00:00:00 2023-11-02 00:00:00
SELECT 8
id start_time start_value end_time end_value
1 2023-10-27 12:00:00 5 2023-10-28 00:00:00 55
1 2023-10-28 00:00:00 55 2023-10-29 00:00:00 60
1 2023-10-29 00:00:00 60 2023-10-30 00:00:00 65
1 2023-10-30 00:00:00 65 2023-10-31 00:00:00 70
1 2023-10-31 00:00:00 70 2023-10-31 12:00:00 72
2 2023-10-30 12:15:00 78 2023-10-31 00:00:00 80
2 2023-10-31 00:00:00 80 2023-11-01 00:00:00 85
2 2023-11-01 00:00:00 85 2023-11-02 00:00:00 90
SELECT 8