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
CREATE INDEX
INSERT 0 199799
count |
---|
199799 |
SELECT 1
Table Name | Index Name | Index Size |
---|---|---|
t | t_a_include_b | 5408 kB |
SELECT 1
ANALYZE
SET
SET
SET
QUERY PLAN |
---|
Limit (cost=0.42..10955.01 rows=1 width=12) (actual time=84.283..84.284 rows=0 loops=1) |
Output: a, b, d |
Buffers: shared hit=198307 |
-> Index Scan using t_a_include_b on public.t (cost=0.42..10955.01 rows=1 width=12) (actual time=84.280..84.281 rows=0 loops=1) |
Output: a, b, d |
Index Cond: (t.a > 1000000) |
Filter: (t.b = 4) |
Rows Removed by Filter: 197805 |
Buffers: shared hit=198307 |
Planning: |
Buffers: shared hit=30 |
Planning Time: 0.201 ms |
Execution Time: 84.303 ms |
EXPLAIN