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?.
260000 rows affected
name | size | pages | rows/page | pages/`a` |
---|---|---|---|---|
foo | 15 MB | 1912 | 135 | 73 |
name | size | pages |
---|---|---|
foo | 15 MB | 1912 |
foo_brin_2 | 24 kB | 3 |
QUERY PLAN |
---|
Aggregate (cost=2152.12..2152.13 rows=1 width=8) (actual time=5.010..5.010 rows=1 loops=1) |
-> Bitmap Heap Scan on foo (cost=89.71..2127.05 rows=10027 width=4) (actual time=0.156..3.296 rows=10000 loops=1) |
Recheck Cond: (a = 'a'::text) |
Rows Removed by Index Recheck: 880 |
Heap Blocks: lossy=80 |
-> Bitmap Index Scan on foo_brin_2 (cost=0.00..87.21 rows=10027 width=0) (actual time=0.125..0.126 rows=800 loops=1) |
Index Cond: (a = 'a'::text) |
Planning time: 2.684 ms |
Execution time: 5.056 ms |