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?.
version |
---|
PostgreSQL 13.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1), 64-bit |
10 rows affected
date | value | sm | cnt | av |
---|---|---|---|---|
2017-11-26 | 5 | 15 | 3 | 5 |
2017-11-26 | 5 | 15 | 3 | 5 |
2017-11-26 | 5 | 15 | 3 | 5 |
2017-11-28 | 20 | 40 | 5 | 8 |
2017-11-28 | 5 | 40 | 5 | 8 |
2018-01-07 | 200 | 265 | 8 | 33 |
2018-01-07 | 5 | 265 | 8 | 33 |
2018-01-07 | 20 | 265 | 8 | 33 |
2018-01-15 | 5 | 270 | 9 | 30 |
2018-01-16 | 50 | 320 | 10 | 32 |
date | running_sum | running_count | running_average |
---|---|---|---|
2017-11-26 | 15 | 3 | 5.0000000000000000 |
2017-11-28 | 40 | 5 | 8.0000000000000000 |
2018-01-07 | 265 | 8 | 33.1250000000000000 |
2018-01-15 | 270 | 9 | 30.0000000000000000 |
2018-01-16 | 320 | 10 | 32.0000000000000000 |