On Tue, Jul 9, 2019 at 11:11 PM Konstantin Malanchev <hombit@gmail.com> wrote:
> Thank you for explanation. work_mem = 512MB and max_parallel_workers_per_gather = 2 and I run only one Postgres
instanceand only one query. EXPLAIN shows "Workers Planned: 2" for this query. Why it can use more than 1GB of
/dev/shm?
For example, if you have one Parallel Hash Join in your plan, it could
allocate up to 512MB * 3 of shared memory (3 = leader process + 2
workers). It sounds like you'll need to set work_mem smaller. If you
run EXPLAIN ANALYZE you'll see how much memory is used by individual
operations. Usually it's regular private anonymous memory, but for
Parallel Hash it's /dev/shm memory.
--
Thomas Munro
https://enterprisedb.com