postgres=# explain (ANALYZE, BUFFERS, VERBOSE, WAL) insert into testscan select a from x where a<80000 or (a%2=0 and a>199900000); QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------ - Gather (cost=4258.59..2063373.72 rows=81338 width=0) (actual time=0.203..310.184 rows=0 loops=1) Workers Planned: 2 Workers Launched: 2 Buffers: shared hit=393777 read=4 dirtied=939 written=953 WAL: records=260356 bytes=16281081 -> Insert on public.testscan (cost=3258.59..2054239.92 rows=0 width=0) (actual time=305.474..305.476 rows=0 loops=2) Buffers: shared hit=393777 read=4 dirtied=939 written=953 WAL: records=260356 bytes=16281081 Worker 0: actual time=305.378..305.379 rows=0 loops=1 Buffers: shared hit=196680 read=3 dirtied=462 written=478 WAL: records=130155 bytes=8129880 Worker 1: actual time=305.570..305.572 rows=0 loops=1 Buffers: shared hit=197097 read=1 dirtied=477 written=475 WAL: records=130201 bytes=8151201 -> Parallel Bitmap Heap Scan on public.x (cost=3258.59..2054239.92 rows=40669 width=8) (actual time=8.883..27.998 rows=65000 loops=2) Output: x.a, NULL::integer Recheck Cond: ((x.a < 80000) OR (x.a > 199900000)) Filter: ((x.a < 80000) OR (((x.a % 2) = 0) AND (x.a > 199900000))) Rows Removed by Filter: 25000 Buffers: shared hit=1476 Worker 0: actual time=8.796..27.982 rows=64992 loops=1 Buffers: shared hit=487 Worker 1: actual time=8.971..28.014 rows=65007 loops=1 Buffers: shared hit=989 -> BitmapOr (cost=3258.59..3258.59 rows=173971 width=0) (actual time=8.810..8.811 rows=0 loops=1) Buffers: shared hit=501 Worker 1: actual time=8.810..8.811 rows=0 loops=1 Buffers: shared hit=501 -> Bitmap Index Scan on x_a_idx (cost=0.00..1495.11 rows=80872 width=0) (actual time=3.832..3.832 rows=79999 loops=1) Index Cond: (x.a < 80000) Buffers: shared hit=223 Worker 1: actual time=3.832..3.832 rows=79999 loops=1 Buffers: shared hit=223 -> Bitmap Index Scan on x_a_idx (cost=0.00..1722.81 rows=93099 width=0) (actual time=4.976..4.976 rows=100000 loops=1) Index Cond: (x.a > 199900000) Buffers: shared hit=278 Worker 1: actual time=4.976..4.976 rows=100000 loops=1 Buffers: shared hit=278 Planning: Buffers: shared hit=19 Planning Time: 0.146 ms Execution Time: 310.257 ms (42 rows)