postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------- Foreign Scan on test_csv (cost=0.00..2158874.49 rows=94056 width=52) (actual time=0.079..17564.457 rows=1000000 loops=1) Filter: ((id % 20) = 6) Rows Removed by Filter: 19000000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.598 ms Execution time: 17592.498 ms (7 rows) postgres=# SET max_parallel_degree = 1; SET postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.237..12123.367 rows=1000000 loops=1) Number of Workers: 1 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=0.469..11983.485 rows=500000 loops=2) Filter: ((id % 20) = 6) Rows Removed by Filter: 9500000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.053 ms Execution time: 12152.998 ms (9 rows) postgres=# SET max_parallel_degree = 2; SET postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.548..10616.097 rows=1000000 loops=1) Number of Workers: 2 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=1.803..10502.100 rows=333333 loops=3) Filter: ((id % 20) = 6) Rows Removed by Filter: 6333333 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.120 ms Execution time: 10647.858 ms (9 rows) postgres=# SET max_parallel_degree = 3; SET postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN --------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.184..9603.485 rows=1000000 loops=1) Number of Workers: 3 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=0.731..9509.899 rows=250000 loops=4) Filter: ((id % 20) = 6) Rows Removed by Filter: 4750000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.049 ms Execution time: 9635.445 ms (9 rows) postgres=# SET max_parallel_degree = 4; SET postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.619..11143.383 rows=1000000 loops=1) Number of Workers: 4 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=15.336..10863.293 rows=200000 loops=5) Filter: ((id % 20) = 6) Rows Removed by Filter: 3800000 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.136 ms Execution time: 11175.456 ms (9 rows) postgres=# SET max_parallel_degree = 5; SET postgres=# explain analyze select * from test_csv where id % 20 = 6; QUERY PLAN ----------------------------------------------------------------------------------------------------------------------------------------- Gather (cost=1000.00..194108.60 rows=94056 width=52) (actual time=0.674..12544.940 rows=1000000 loops=1) Number of Workers: 5 -> Parallel Foreign Scan on test_csv (cost=0.00..183703.00 rows=94056 width=52) (actual time=23.652..12279.323 rows=166667 loops=6) Filter: ((id % 20) = 6) Rows Removed by Filter: 3166667 Foreign File: /tmp/testdata.csv Foreign File Size: 1504892535 Planning time: 0.139 ms Execution time: 12586.457 ms (9 rows)