create table test_table (a bigint, b bigint, c text) with (fillfactor = 25); insert into test_table select a, b, c from (select a, b, c, generate_series(1,24) from (select a, b, c from (select (416 * random())::int a, i b, md5(random()::text) c from generate_series(1, 1000000/24) s(i)) foo) bar) baz; create index on test_table (a); vacuum analyze; checkpoint; -- 0012 set effective_io_concurrency = 0; set work_mem = '4MB'; explain analyze select * from test_table where (a >= 53) AND (a <= 264); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- Bitmap Heap Scan on test_table (cost=6030.91..55240.07 rows=502877 width=49) (actual time=21.821..406.664 rows=508440 loops=1) Recheck Cond: ((a >= 53) AND (a <= 264)) Heap Blocks: exact=21185 -> Bitmap Index Scan on test_table_a_idx (cost=0.00..5905.20 rows=502877 width=0) (actual time=18.599..18.599 rows=508440 loops=1) Index Cond: ((a >= 53) AND (a <= 264)) Planning Time: 5.235 ms Execution Time: 421.185 ms (7 rows) -- 0014 set effective_io_concurrency = 0; set work_mem = '4MB'; explain analyze select * from test_table where (a >= 53) AND (a <= 264); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- Bitmap Heap Scan on test_table (cost=6030.91..55240.07 rows=502877 width=49) (actual time=21.894..2697.074 rows=508440 loops=1) Recheck Cond: ((a >= 53) AND (a <= 264)) Heap Blocks: exact=21185 -> Bitmap Index Scan on test_table_a_idx (cost=0.00..5905.20 rows=502877 width=0) (actual time=18.714..18.715 rows=508440 loops=1) Index Cond: ((a >= 53) AND (a <= 264)) Planning Time: 4.943 ms Execution Time: 2730.409 ms (7 rows)