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?.
7 rows affected
4 rows affected
17 rows affected
activity_id | parent_activity_id | start_date | cumulative_duration |
---|---|---|---|
1 | 0 | 2021-07-26 00:00:00+01 | 66 |
2 | 1 | 2021-07-26 00:00:00+01 | 35 |
3 | 2 | 2021-07-26 00:00:00+01 | 18 |
1 | 0 | 2021-07-27 00:00:00+01 | 45 |
2 | 1 | 2021-07-27 00:00:00+01 | 34 |
3 | 2 | 2021-07-27 00:00:00+01 | 27 |
4 | 0 | 2021-07-26 00:00:00+01 | 39 |
5 | 4 | 2021-07-26 00:00:00+01 | 39 |
6 | 5 | 2021-07-26 00:00:00+01 | 39 |
4 | 0 | 2021-07-27 00:00:00+01 | 50 |
5 | 4 | 2021-07-27 00:00:00+01 | 50 |
6 | 5 | 2021-07-27 00:00:00+01 | 39 |
7 | 0 | 2021-07-01 00:00:00+01 | 10 |