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 9
id | author | size | python | cpp | non-code |
---|---|---|---|---|---|
1 | a | 28385 | 1 | 1 | 1 |
2 | b | 10633 | 2 | 1 | 1 |
3 | c | 2338 | 1 | 1 | 0 |
SELECT 3
id | author | size | file_ext | ct |
---|---|---|---|---|
1 | a | 13513 | cpp | 1 |
1 | a | 1211 | non-code | 1 |
1 | a | 13661 | python | 1 |
2 | b | 6881 | cpp | 1 |
2 | b | 1208 | non-code | 1 |
2 | b | 2544 | python | 2 |
3 | c | 1299 | cpp | 1 |
3 | c | 1039 | python | 1 |
SELECT 8
id | author | size | file_ext | ct |
---|---|---|---|---|
1 | a | 28385 | cpp | 1 |
1 | a | 28385 | non-code | 1 |
1 | a | 28385 | python | 1 |
2 | b | 10633 | cpp | 1 |
2 | b | 10633 | non-code | 1 |
2 | b | 10633 | python | 2 |
3 | c | 2338 | cpp | 1 |
3 | c | 2338 | python | 1 |
SELECT 8
id | author | size | python | cpp | non-code |
---|---|---|---|---|---|
1 | a | 28385 | 1 | 1 | 1 |
2 | b | 10633 | 2 | 1 | 1 |
3 | c | 2338 | 1 | 1 | 0 |
SELECT 3