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?.
6 rows affected
1000 rows affected
QUERY PLAN
Seq Scan on t (cost=0.00..20.09 rows=5 width=254) (actual time=0.014..0.092 rows=2 loops=1)
  Filter: (array_length(x, 1) = y)
  Rows Removed by Filter: 1004
Planning Time: 0.393 ms
Execution Time: 0.105 ms
QUERY PLAN
Bitmap Heap Scan on t (cost=4.31..9.69 rows=5 width=254) (actual time=0.045..0.045 rows=0 loops=1)
  Recheck Cond: (((array_length(x, 1) = y))::character(1) = 'Y'::bpchar)
  -> Bitmap Index Scan on ix_t_int (cost=0.00..4.31 rows=5 width=0) (actual time=0.043..0.043 rows=0 loops=1)
        Index Cond: (((array_length(x, 1) = y))::character(1) = 'Y'::bpchar)
Planning Time: 0.250 ms
Execution Time: 0.067 ms
QUERY PLAN
Bitmap Heap Scan on t (cost=4.31..11.31 rows=5 width=286) (actual time=0.025..0.026 rows=2 loops=1)
  Recheck Cond: (state = 'SOLVED'::text)
  Heap Blocks: exact=1
  -> Bitmap Index Scan on ix_t_calc (cost=0.00..4.31 rows=5 width=0) (actual time=0.020..0.020 rows=2 loops=1)
        Index Cond: (state = 'SOLVED'::text)
Planning Time: 0.307 ms
Execution Time: 0.047 ms