Vertically Scaling PostgreSQL
Subject to the overall limit of set earlier, Postgres will determine how many workers can be spawned for parallel query depending on the value of two configuration settings:
If you have idle CPUs and parallelizable queries, increasing these values can speedup such queries. If you’ve managed to increase the OS disk cache significantly (by increasing the available memory), increasing this configuration setting might help in improving the planner’s estimates:
PostgreSQL uses a set of buffers that is shared between all workers and backend processes. Increasing this from the default of 4MB can let queries complete faster by during temporary table creation:
The memory used by VACUUM, index creation and other such maintenance commands are controlled by the configuration setting .
Source: pgdash.io