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?.
3 rows affected
id moves evaluation
1 {b4,e5,Bb2,d6,Nf3,Nf6,g3,Bg4,Bg2,h5} {1,2,3,4,5,6,7,8,9,10}
2 {b4,e5,Bb2,d6,Nf3,Nf6,g3,Bg4,Bg2,h6} {2,2,3,4,5,6,7,8,9,11}
id moves evaluation
1 {b4,e5,Bb2,d6,Nf3,Nf6,g3,Bg4,Bg2,h5} {1,2,3,4,5,6,7,8,9,10}
QUERY PLAN
Index Scan using records_8moves_idx on records (cost=0.13..12.17 rows=1 width=516) (actual time=0.021..0.024 rows=1 loops=1)
  Index Cond: (f_8moves((moves)::text[]) = 'b4e5Bb2d6Nf3Nf6g3Bg4'::text COLLATE "C")
  Filter: ((evaluation IS NOT NULL) AND (moves[1:10] = '{b4,e5,Bb2,d6,Nf3,Nf6,g3,Bg4,Bg2,h5}'::character varying[]))
  Rows Removed by Filter: 1
Planning Time: 0.107 ms
Execution Time: 0.048 ms
QUERY PLAN
Index Scan using records_8moves_idx on records (cost=0.13..12.17 rows=1 width=516) (actual time=0.010..0.012 rows=1 loops=1)
  Index Cond: (f_8moves((moves)::text[]) = 'b4e5Bb2d6Nf3Nf6g3Bg4'::text COLLATE "C")
  Filter: ((evaluation IS NOT NULL) AND (moves[1:10] = '{b4,e5,Bb2,d6,Nf3,Nf6,g3,Bg4,Bg2,h5}'::character varying[]))
  Rows Removed by Filter: 1
Planning Time: 0.094 ms
Execution Time: 0.024 ms
QUERY PLAN
Index Scan using records_8moves_idx on records (cost=0.13..12.68 rows=1 width=516) (actual time=0.041..0.049 rows=2 loops=1)
  Index Cond: ((f_8moves((moves)::text[]) >= 'b4e5'::text) AND (f_8moves((moves)::text[]) < 'b4e6'::text))
  Filter: ((evaluation IS NOT NULL) AND (moves[1:2] = '{b4,e5}'::character varying[]) AND (f_8moves((moves)::text[]) ~~ 'b4e5%'::text COLLATE "C"))
Planning Time: 0.198 ms
Execution Time: 0.063 ms