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 6
CREATE TABLE
consumer_id | start_time | end_time |
---|---|---|
1 | 2023-09-24 20:00:00 | 2023-09-25 00:00:00 |
2 | 2023-09-24 21:00:00 | 2023-09-25 13:00:00 |
1 | 2023-09-26 20:00:00 | 2023-09-28 02:00:00 |
3 | 2023-09-25 19:00:00 | 2023-09-26 10:00:00 |
4 | 2023-09-25 21:30:00 | 2023-09-27 14:00:00 |
5 | 2023-09-25 21:30:00 | 2023-09-25 22:00:00 |
SELECT 6
consumer_id | start_time | end_time | isdaydiff |
---|
SELECT 0