Parameter · Query Tuning / Planner Cost Constants
min_parallel_table_scan_size
Sets the minimum amount of table data for a parallel scan. If the planner estimates that it will read a number of table pages too small to reach this limit, a parallel scan will not be considered.
- Default:
8MB - Type: integer (8kB)
- Range: 0 … 5726623056kB
- Applies: Session (any user)
In plain words
Parallel workers only pay off for big tables. Tables smaller than this size are never scanned in parallel. Above it, the planner plans one worker, and one more each time the table is three times larger, up to the per-query worker limit.
For DBAs and operators
The rule (in compute_parallel_worker()): a table with fewer pages than this value gets 0 workers. Otherwise it gets 1 worker, plus 1 each time the size reaches 3×, 9×, 27× … the threshold. With the default 8MB: 8MB → 1, 24MB → 2, 72MB → 3, 216MB → 4, and so on. The result is then capped by max_parallel_workers_per_gather (2 by default), which is why most parallel plans show Workers Planned: 2.
A table can override the calculation with ALTER TABLE … SET (parallel_workers = 8), which skips both this threshold and the log-3 rule (the per-gather cap still applies). Size is measured in pages; for a table the planner uses its current physical size (the number of blocks in the file at planning time), not the pg_class.relpages value from the last VACUUM/ANALYZE.
Lowering it to 0 lets even tiny tables be scanned in parallel, which is useful only for testing. For parallel index scans both this and min_parallel_index_scan_size apply, and the smaller worker count of the two is used.
How to change it
Any user can change it for their session with SET.
See it in context
Related parameters
min_parallel_index_scan_size max_parallel_workers_per_gather parallel_setup_cost parallel_tuple_cost