add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
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.041..0.042 rows=0 loops=1)
  Index Cond: ((word ~>=~ 'data'::text) AND (word ~<~ 'datb'::text))
  Filter: (word ~~ 'data%'::text)
  Heap Fetches: 0
Planning Time: 0.527 ms
Execution Time: 0.105 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.140 ms
Execution Time: 0.024 ms
EXPLAIN
QUERY PLAN
Index Only Scan using words_word on words (actual time=0.006..0.006 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.069 ms
Execution Time: 0.017 ms
EXPLAIN