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?.
396 rows affected
count | count |
---|---|
396 | 8 |
QUERY PLAN |
---|
Aggregate (cost=1.17..1.18 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=1) |
Output: count(*) |
Buffers: shared hit=1 |
-> Seq Scan on public.demo1 (cost=0.00..1.14 rows=11 width=0) (actual time=0.008..0.010 rows=11 loops=1) |
Filter: (demo1.n = 1) |
Buffers: shared hit=1 |
Planning Time: 0.126 ms |
Execution Time: 0.038 ms |
QUERY PLAN |
---|
Aggregate (cost=1.33..1.34 rows=1 width=8) (actual time=0.016..0.016 rows=1 loops=1) |
Output: count(*) |
Buffers: shared hit=1 |
-> Seq Scan on public.demo2 (cost=0.00..1.27 rows=22 width=0) (actual time=0.009..0.012 rows=22 loops=1) |
Filter: (demo2.n = 2) |
Buffers: shared hit=1 |
Planning Time: 0.082 ms |
Execution Time: 0.031 ms |
QUERY PLAN |
---|
Aggregate (cost=1.50..1.51 rows=1 width=8) (actual time=0.018..0.018 rows=1 loops=1) |
Output: count(*) |
Buffers: shared hit=1 |
-> Seq Scan on public.demo3 (cost=0.00..1.41 rows=33 width=0) (actual time=0.009..0.013 rows=33 loops=1) |
Filter: (demo3.n = 3) |
Buffers: shared hit=1 |
Planning Time: 0.073 ms |
Execution Time: 0.033 ms |
QUERY PLAN |
---|
Aggregate (cost=1.66..1.67 rows=1 width=8) (actual time=0.020..0.020 rows=1 loops=1) |
Output: count(*) |
Buffers: shared hit=1 |
-> Seq Scan on public.demo4 (cost=0.00..1.55 rows=44 width=0) (actual time=0.009..0.015 rows=44 loops=1) |
Filter: (demo4.n = 4) |
Buffers: shared hit=1 |
Planning Time: 0.064 ms |
Execution Time: 0.034 ms |
QUERY PLAN |
---|
Aggregate (cost=1.82..1.83 rows=1 width=8) (actual time=0.022..0.023 rows=1 loops=1) |
Output: count(*) |
Buffers: shared hit=1 |
-> Seq Scan on public.demo5 (cost=0.00..1.69 rows=55 width=0) (actual time=0.009..0.016 rows=55 loops=1) |
Filter: (demo5.n = 5) |
Buffers: shared hit=1 |
Planning Time: 0.062 ms |
Execution Time: 0.037 ms |
QUERY PLAN |
---|
Aggregate (cost=1.99..2.00 rows=1 width=8) (actual time=0.025..0.025 rows=1 loops=1) |
Output: count(*) |
Buffers: shared hit=1 |
-> Seq Scan on public.demo6 (cost=0.00..1.83 rows=66 width=0) (actual time=0.010..0.018 rows=66 loops=1) |
Filter: (demo6.n = 6) |
Buffers: shared hit=1 |
Planning Time: 0.188 ms |
Execution Time: 0.039 ms |
QUERY PLAN |
---|
Aggregate (cost=2.15..2.16 rows=1 width=8) (actual time=0.027..0.027 rows=1 loops=1) |
Output: count(*) |
Buffers: shared hit=1 |
-> Seq Scan on public.demo7 (cost=0.00..1.96 rows=77 width=0) (actual time=0.010..0.019 rows=77 loops=1) |
Filter: (demo7.n = 7) |
Buffers: shared hit=1 |
Planning Time: 0.060 ms |
Execution Time: 0.041 ms |
QUERY PLAN |
---|
Aggregate (cost=2.32..2.33 rows=1 width=8) (actual time=0.029..0.029 rows=1 loops=1) |
Output: count(*) |
Buffers: shared hit=1 |
-> Seq Scan on public.demo8 (cost=0.00..2.10 rows=88 width=0) (actual time=0.010..0.020 rows=88 loops=1) |
Filter: (demo8.n = 8) |
Buffers: shared hit=1 |
Planning Time: 0.060 ms |
Execution Time: 0.043 ms |
QUERY PLAN |
---|
Aggregate (cost=0.00..0.01 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1) |
Output: count(*) |
-> Result (cost=0.00..0.00 rows=0 width=0) (actual time=0.001..0.001 rows=0 loops=1) |
One-Time Filter: false |
Planning Time: 0.033 ms |
Execution Time: 0.014 ms |