1.4.7 Parallel Cost: When to Go Parallel and How Many Workers (opens in new tab)
The planner weighs how to read a table, how to join, and how to aggregate by cost, and picks the cheapest candidate. Parallel query is one more decision layered on top of those candidates: whether one process handles a given scan or join alone, or several processes split the work, and if they split it, among how many. This decision is also made by the planner, not the executor. The planner costs a parallel candidate separately, puts it on the same scale as the serial one, and keeps whichever ...
Read the original article