set effective_io_concurrency=0; set enable_indexscan=off; set enable_seqscan=off; explain (analyze, buffers)  select * from test where id between 2000 and 100000 and val != '';
                                                         QUERY PLAN                                                         
----------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=139.425..649.815 rows=98001 loops=1)
   Recheck Cond: ((id >= 2000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1509
   Buffers: shared read=1779
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=138.175..138.175 rows=98001 loops=1)
         Index Cond: ((id >= 2000) AND (id <= 100000))
         Buffers: shared read=270
 Planning time: 258.668 ms
 Execution time: 656.086 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 2000 and 100000 and val != '';
                                                         QUERY PLAN                                                         
----------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=217.879..6149.597 rows=98001 loops=1)
   Recheck Cond: ((id >= 2000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1509
   Buffers: shared read=1779
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=216.865..216.865 rows=98001 loops=1)
         Index Cond: ((id >= 2000) AND (id <= 100000))
         Buffers: shared read=270
 Planning time: 109.382 ms
 Execution time: 6156.003 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 2000 and 100000 and val != '';
                                                         QUERY PLAN                                                         
----------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=108.603..762.334 rows=98001 loops=1)
   Recheck Cond: ((id >= 2000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1509
   Buffers: shared read=1779
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=107.648..107.648 rows=98001 loops=1)
         Index Cond: ((id >= 2000) AND (id <= 100000))
         Buffers: shared read=270
 Planning time: 98.214 ms
 Execution time: 768.288 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 2000 and 100000 and val != '';
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=98.980..4911.180 rows=98001 loops=1)
   Recheck Cond: ((id >= 2000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1509
   Buffers: shared read=1779
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=98.009..98.009 rows=98001 loops=1)
         Index Cond: ((id >= 2000) AND (id <= 100000))
         Buffers: shared read=270
 Planning time: 62.930 ms
 Execution time: 4917.423 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 2000 and 100000 and val != '';
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=57.390..495.070 rows=98001 loops=1)
   Recheck Cond: ((id >= 2000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1509
   Buffers: shared read=1779
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=56.446..56.446 rows=98001 loops=1)
         Index Cond: ((id >= 2000) AND (id <= 100000))
         Buffers: shared read=270
 Planning time: 84.377 ms
 Execution time: 500.931 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 2000 and 100000 and val != '';
                                                          QUERY PLAN                                                          
------------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=1091.351..5652.894 rows=98001 loops=1)
   Recheck Cond: ((id >= 2000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1509
   Buffers: shared read=1779
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=1090.399..1090.399 rows=98001 loops=1)
         Index Cond: ((id >= 2000) AND (id <= 100000))
         Buffers: shared read=270
 Planning time: 67.075 ms
 Execution time: 5659.255 ms
(10 rows)

