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 10
ts | status | flag |
---|---|---|
1 | m | 1 |
2 | m | 1 |
3 | i | 1 |
4 | s | 1 |
5 | s | 1 |
6 | i | 2 |
7 | i | 2 |
8 | m | 2 |
9 | s | 2 |
10 | m | 3 |
SELECT 10