set effective_io_concurrency=0; set enable_indexscan=off; set enable_seqscan=off; explain (analyze, buffers)  select * from test where id between 20000 and 100000 and val != '';
                                                         QUERY PLAN                                                         
----------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=216.288..430.513 rows=80001 loops=1)
   Recheck Cond: ((id >= 20000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1232
   Buffers: shared read=1453
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=215.711..215.711 rows=80001 loops=1)
         Index Cond: ((id >= 20000) AND (id <= 100000))
         Buffers: shared read=221
 Planning time: 84.390 ms
 Execution time: 435.503 ms
(10 rows)

set effective_io_concurrency=1; set enable_indexscan=off; set enable_seqscan=off; explain (analyze, buffers)  select * from test where id between 20000 and 100000 and val != '';
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=61.437..5454.388 rows=80001 loops=1)
   Recheck Cond: ((id >= 20000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1232
   Buffers: shared read=1453
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=60.834..60.834 rows=80001 loops=1)
         Index Cond: ((id >= 20000) AND (id <= 100000))
         Buffers: shared read=221
 Planning time: 45.603 ms
 Execution time: 5460.730 ms
(10 rows)

set effective_io_concurrency=0; set enable_indexscan=off; set enable_seqscan=off; explain (analyze, buffers)  select * from test where id between 20000 and 100000 and val != '';
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=56.820..449.410 rows=80001 loops=1)
   Recheck Cond: ((id >= 20000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1232
   Buffers: shared read=1453
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=55.927..55.927 rows=80001 loops=1)
         Index Cond: ((id >= 20000) AND (id <= 100000))
         Buffers: shared read=221
 Planning time: 80.611 ms
 Execution time: 454.323 ms
(10 rows)

set effective_io_concurrency=1; set enable_indexscan=off; set enable_seqscan=off; explain (analyze, buffers)  select * from test where id between 20000 and 100000 and val != '';
                                                         QUERY PLAN                                                         
----------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=203.238..4157.711 rows=80001 loops=1)
   Recheck Cond: ((id >= 20000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1232
   Buffers: shared read=1453
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=202.250..202.250 rows=80001 loops=1)
         Index Cond: ((id >= 20000) AND (id <= 100000))
         Buffers: shared read=221
 Planning time: 208.191 ms
 Execution time: 4163.030 ms
(10 rows)

set effective_io_concurrency=0; set enable_indexscan=off; set enable_seqscan=off; explain (analyze, buffers)  select * from test where id between 20000 and 100000 and val != '';
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=59.079..668.701 rows=80001 loops=1)
   Recheck Cond: ((id >= 20000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1232
   Buffers: shared read=1453
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=58.190..58.190 rows=80001 loops=1)
         Index Cond: ((id >= 20000) AND (id <= 100000))
         Buffers: shared read=221
 Planning time: 570.548 ms
 Execution time: 674.382 ms
(10 rows)

set effective_io_concurrency=1; set enable_indexscan=off; set enable_seqscan=off; explain (analyze, buffers)  select * from test where id between 20000 and 100000 and val != '';
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=67.477..3697.716 rows=80001 loops=1)
   Recheck Cond: ((id >= 20000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1232
   Buffers: shared read=1453
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=66.923..66.923 rows=80001 loops=1)
         Index Cond: ((id >= 20000) AND (id <= 100000))
         Buffers: shared read=221
 Planning time: 37.706 ms
 Execution time: 3703.045 ms
(10 rows)

