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 15.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10), 64-bit |
SELECT 1
setseed |
---|
SELECT 1
SELECT 100
SELECT 200
cnt1 | cnt2 | cnt3 | cnt4 |
---|---|---|---|
2031 | 225 | 17 | 2 |
SELECT 1
b | c | d | grouping | count |
---|---|---|---|---|
t | t | t | 0 | 2 |
t | t | null | 1 | 17 |
t | null | null | 3 | 225 |
null | null | null | 7 | 2031 |
SELECT 4
?column? | ?column? | ?column? | grouping | count |
---|---|---|---|---|
t | t | t | 0 | 2 |
f | t | f | 0 | 148 |
t | t | f | 0 | 15 |
f | f | t | 0 | 163 |
t | f | t | 0 | 19 |
t | f | f | 0 | 189 |
f | t | t | 0 | 26 |
f | f | f | 0 | 1469 |
t | f | null | 1 | 208 |
t | t | null | 1 | 17 |
f | f | null | 1 | 1632 |
f | t | null | 1 | 174 |
t | null | null | 3 | 225 |
f | null | null | 3 | 1806 |
null | null | null | 7 | 2031 |
SELECT 15