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?.
6 rows affected
4 rows affected
16 rows affected
ultimate_parent_activity_id | activity_id | parent_activity_id | level | start_date | activity_duration | cumulative_duration |
---|---|---|---|---|---|---|
1 | 1 | 0 | 1 | 2021-07-26 | 31 | 66 |
1 | 2 | 1 | 2 | 2021-07-26 | 17 | 35 |
1 | 3 | 2 | 3 | 2021-07-26 | 18 | 18 |
1 | 1 | 0 | 1 | 2021-07-27 | 11 | 45 |
1 | 2 | 1 | 2 | 2021-07-27 | 7 | 34 |
1 | 3 | 2 | 3 | 2021-07-27 | 27 | 27 |
4 | 6 | 5 | 3 | 2021-07-26 | 39 | 39 |
4 | 5 | 4 | 2 | 2021-07-27 | 11 | 50 |
4 | 6 | 5 | 3 | 2021-07-27 | 39 | 39 |
4 | 4 | 0 | 1 | null | null | null |