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
INSERT 0 2
id | u_name | date | time_in | time_out | duration |
---|---|---|---|---|---|
1 | XXXXXXXX | 2020-08-20 | 2020-08-20 16:00:00 | 2020-08-21 00:00:00 | 07:00:00 |
1 | XXXXXXXX | 2020-08-21 | 2020-08-21 00:00:00 | 2020-08-21 19:00:00 | 04:00:00 |
2 | YYYYYYYY | null | null | null | null |
SELECT 3