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?.
11 rows affected
id | day | price | cumsum | grp |
---|---|---|---|---|
1 | 1 | 40 | 40 | 0 |
2 | 1 | 40 | 80 | 0 |
3 | 1 | 40 | 120 | 1 |
4 | 1 | 40 | 160 | 2 |
5 | 1 | 40 | 200 | 2 |
6 | 1 | 40 | 240 | 3 |
7 | 2 | 40 | 40 | 0 |
8 | 2 | 40 | 80 | 0 |
9 | 2 | 40 | 120 | 1 |
10 | 2 | 40 | 160 | 2 |
11 | 2 | 40 | 200 | 2 |