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 100000
CREATE INDEX
VACUUM
QUERY PLAN |
---|
Aggregate (cost=2210.29..2210.30 rows=1 width=8) (actual time=19.269..19.270 rows=1 loops=1) |
-> Index Only Scan using some_integer_idx on test (cost=0.29..1960.29 rows=100000 width=4) (actual time=0.021..9.946 rows=100000 loops=1) |
Heap Fetches: 0 |
Planning Time: 0.158 ms |
Execution Time: 19.397 ms |
EXPLAIN