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?.
6 rows affected
16 rows affected
activity_id parent_activity_id date duration count latest
1 null 2021-07-26 00:00:00 00:31:00 2 2021-07-26 10:00:00
1 null 2021-07-27 00:00:00 00:11:00 2 2021-07-27 10:00:00
2 1 2021-07-26 00:00:00 00:17:00 1 2021-07-26 11:00:00
2 1 2021-07-27 00:00:00 00:07:00 1 2021-07-27 11:00:00
3 2 2021-07-27 00:00:00 00:27:00 3 2021-07-27 14:00:00
3 2 2021-07-26 00:00:00 00:18:00 1 2021-07-26 12:00:00
5 4 2021-07-27 00:00:00 00:11:00 1 2021-07-27 15:00:00
6 5 2021-07-27 00:00:00 00:39:00 3 2021-07-27 17:00:00
6 5 2021-07-26 00:00:00 00:39:00 2 2021-07-26 14:00:00
row_number activity_id name day_duration date
1 1 C1 45 2021-07-27 00:00:00
2 1 C1 66 2021-07-26 00:00:00
3 2 C1 P1 35 2021-07-26 00:00:00
4 2 C1 P1 34 2021-07-27 00:00:00
5 3 C1 P1 T1 27 2021-07-27 00:00:00
6 3 C1 P1 T1 18 2021-07-26 00:00:00
7 4 C2 null null
8 5 C2 P1 50 2021-07-27 00:00:00
9 6 C2 P1 T1 39 2021-07-26 00:00:00
10 6 C2 P1 T1 39 2021-07-27 00:00:00