postgres=# explain analyze select * from test_csv where id % 100 = 100; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------- Foreign Scan on test_csv (cost=0.00..2158874.49 rows=94056 width=52) (actual time=17550.811..17550.811 rows=0 loops=1) Filter: ((id % 100) = 100) Rows Removed by Filter: 20000000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 1.175 ms Execution time: 17551.011 ms (7 rows) postgres=# SET max_parallel_degree = 1; SET postgres=# explain analyze select * from test_csv where id % 100 = 100; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=18054.651..18054.651 rows=0 loops=1) Number of Workers: 1 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=18048.975..18048.975 rows=0 loops=2) Filter: ((id % 100) = 100) Rows Removed by Filter: 20000000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.461 ms Execution time: 18055.185 ms (9 rows) postgres=# SET max_parallel_degree = 2; SET postgres=# explain analyze select * from test_csv where id % 100 = 100; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=18567.518..18567.518 rows=0 loops=1) Number of Workers: 2 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=14593.974..14593.974 rows=0 loops=3) Filter: ((id % 100) = 100) Rows Removed by Filter: 13333333 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.133 ms Execution time: 18567.660 ms (9 rows) postgres=# SET max_parallel_degree = 3; SET postgres=# explain analyze select * from test_csv where id % 100 = 100; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=18649.676..18649.676 rows=0 loops=1) Number of Workers: 3 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=12671.429..12671.429 rows=0 loops=4) Filter: ((id % 100) = 100) Rows Removed by Filter: 10000000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.132 ms Execution time: 18649.819 ms (9 rows) postgres=# SET max_parallel_degree = 4; SET postgres=# explain analyze select * from test_csv where id % 100 = 100; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=20619.039..20619.039 rows=0 loops=1) Number of Workers: 4 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=13606.715..13606.715 rows=0 loops=5) Filter: ((id % 100) = 100) Rows Removed by Filter: 8000000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.133 ms Execution time: 20619.184 ms (9 rows) postgres=# SET max_parallel_degree = 5; SET postgres=# explain analyze select * from test_csv where id % 100 = 100; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=22557.451..22557.451 rows=0 loops=1) Number of Workers: 5 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=14594.420..14594.420 rows=0 loops=6) Filter: ((id % 100) = 100) Rows Removed by Filter: 6666667 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.125 ms Execution time: 22557.575 ms (9 rows)