set effective_io_concurrency=0; set enable_indexscan=off; set enable_seqscan=off; explain (analyze, buffers)  select * from test where id between 5000 and 100000 and val != '';
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=91.818..749.054 rows=95001 loops=1)
   Recheck Cond: ((id >= 5000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1463
   Buffers: shared read=1725
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=90.917..90.917 rows=95001 loops=1)
         Index Cond: ((id >= 5000) AND (id <= 100000))
         Buffers: shared read=262
 Planning time: 102.098 ms
 Execution time: 755.440 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 5000 and 100000 and val != '';
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=89.526..5135.535 rows=95001 loops=1)
   Recheck Cond: ((id >= 5000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1463
   Buffers: shared read=1725
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=88.620..88.620 rows=95001 loops=1)
         Index Cond: ((id >= 5000) AND (id <= 100000))
         Buffers: shared read=262
 Planning time: 73.786 ms
 Execution time: 5141.671 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 5000 and 100000 and val != '';
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=78.338..536.456 rows=95001 loops=1)
   Recheck Cond: ((id >= 5000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1463
   Buffers: shared read=1725
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=77.397..77.397 rows=95001 loops=1)
         Index Cond: ((id >= 5000) AND (id <= 100000))
         Buffers: shared read=262
 Planning time: 209.664 ms
 Execution time: 542.174 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 5000 and 100000 and val != '';
                                                         QUERY PLAN                                                         
----------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=199.436..6068.902 rows=95001 loops=1)
   Recheck Cond: ((id >= 5000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1463
   Buffers: shared read=1725
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=198.501..198.501 rows=95001 loops=1)
         Index Cond: ((id >= 5000) AND (id <= 100000))
         Buffers: shared read=262
 Planning time: 64.237 ms
 Execution time: 6074.953 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 5000 and 100000 and val != '';
                                                        QUERY PLAN                                                        
--------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=100.866..564.803 rows=95001 loops=1)
   Recheck Cond: ((id >= 5000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1463
   Buffers: shared read=1725
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=99.926..99.926 rows=95001 loops=1)
         Index Cond: ((id >= 5000) AND (id <= 100000))
         Buffers: shared read=262
 Planning time: 93.469 ms
 Execution time: 570.615 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 5000 and 100000 and val != '';
                                                         QUERY PLAN                                                         
----------------------------------------------------------------------------------------------------------------------------
 Bitmap Heap Scan on test  (cost=7.62..467.66 rows=498 width=36) (actual time=100.767..6916.191 rows=95001 loops=1)
   Recheck Cond: ((id >= 5000) AND (id <= 100000))
   Filter: (val <> ''::text)
   Heap Blocks: exact=1463
   Buffers: shared read=1725
   ->  Bitmap Index Scan on test_pkey  (cost=0.00..7.49 rows=500 width=0) (actual time=100.165..100.165 rows=95001 loops=1)
         Index Cond: ((id >= 5000) AND (id <= 100000))
         Buffers: shared read=262
 Planning time: 92.432 ms
 Execution time: 6922.402 ms
(10 rows)

