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?.
CREATE TABLE
INSERT 0 8
date | platform | total_amount | total_users |
---|---|---|---|
2023-12-01 | both | 60.67 | 1 |
2023-12-01 | desktop | 22.00 | 1 |
2023-12-01 | mobile | 83.46 | 1 |
2023-12-02 | desktop | 19.90 | 1 |
2023-12-02 | mobile | 107.44 | 2 |
2023-12-03 | mobile | 28.28 | 1 |
SELECT 6
date | platform | total_amount | total_users |
---|---|---|---|
2023-12-01 | desktop | 22.00 | 1 |
2023-12-01 | both | 60.67 | 1 |
2023-12-01 | mobile | 83.46 | 1 |
2023-12-02 | both | 0 | 0 |
2023-12-02 | desktop | 19.90 | 1 |
2023-12-02 | mobile | 107.44 | 2 |
2023-12-03 | both | 0 | 0 |
2023-12-03 | desktop | 0 | 0 |
2023-12-03 | mobile | 28.28 | 1 |
SELECT 9