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
VACUUM
CREATE INDEX
QUERY PLAN |
---|
Index Only Scan using words_word on words (actual time=0.033..0.033 rows=0 loops=1) |
Index Cond: ((word ~>=~ 'data'::text) AND (word ~<~ 'datb'::text)) |
Filter: (word ~~ 'data%'::text) |
Heap Fetches: 0 |
Planning Time: 0.419 ms |
Execution Time: 0.106 ms |
EXPLAIN
VACUUM
QUERY PLAN |
---|
Index Only Scan using words_word on words (actual time=0.007..0.007 rows=0 loops=1) |
Index Cond: ((word ~>=~ 'data'::text) AND (word ~<~ 'datb'::text)) |
Filter: (word ^@ 'data'::text) |
Heap Fetches: 0 |
Planning Time: 0.190 ms |
Execution Time: 0.020 ms |
EXPLAIN
QUERY PLAN |
---|
Index Only Scan using words_word on words (actual time=0.005..0.005 rows=0 loops=1) |
Index Cond: ((word ~>=~ 'data'::text) AND (word ~<~ 'datb'::text)) |
Filter: starts_with(word, 'data'::text) |
Heap Fetches: 0 |
Planning Time: 0.073 ms |
Execution Time: 0.015 ms |
EXPLAIN