From: Konstantin Malanchev <hombit@gmail.com>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: Jean Louis <bugs@gnu.support>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: PGSQL 11.4: shared_buffers and /dev/shm size
Date: Tue, 9 Jul 2019 15:27:56 +0300
Message-ID: <2A639837-888D-474F-AE91-8BBB65952D70@gmail.com> (raw)
In-Reply-To: <CA+hUKGJJPpOcCX946DEFr+uTf4KO22k=ppBL=9BHi=CyL_=unQ@mail.gmail.com>
References: <7E4D7DA4-E093-4F6A-AE8E-81A73B995A8D@gmail.com>
<20190709095344.GK7323@protected.rcdrun.com>
<63682227-874F-43A9-8879-DE875DE9BCC3@gmail.com>
<20190709101514.GB10233@protected.rcdrun.com>
<CA+hUKGJOj7qzDLxeFPVvto8YEWop6FSQoTYPO9Z6Ee=i-nPS_Q@mail.gmail.com>
<825554F8-7D18-4DFA-B01F-5F3A47A66749@gmail.com>
<CA+hUKGJJPpOcCX946DEFr+uTf4KO22k=ppBL=9BHi=CyL_=unQ@mail.gmail.com>
Thank you!
> 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).
I'm executing the query with smaller work_mem, it will take some time. But I still confused why it used all /dev/shm (4GB) and fails with "no space left" error while work_mem = 512MB.
> If you
> run EXPLAIN ANALYZE you'll see how much memory is used by individual
> operations.
I cannot run EXPLAIN ANALYSE, because the query fails. This is explanation for the query:
EXPLAIN
CREATE MATERIALIZED VIEW IF NOT EXISTS new_mat_view
AS
SELECT * FROM my_view
INNER JOIN another_mat_view USING (oid)
ORDER BY oid, field_name;
Gather Merge (cost=5696039356565.87..10040767101103.24 rows=37237923518438 width=31)
Workers Planned: 2
-> Sort (cost=5696039355565.85..5742586759963.90 rows=18618961759219 width=31)
Sort Key: my_table.oid, my_table.field_name
-> Parallel Hash Join (cost=11030236131.39..255829470118.27 rows=18618961759219 width=31)
Hash Cond: (another_mat_view.oid = my_table.oid)
-> Parallel Seq Scan on another_mat_view (cost=0.00..652514.56 rows=31645556 width=8)
-> Parallel Hash (cost=636676233.38..636676233.38 rows=20353804801 width=31)
-> Parallel Seq Scan on my_table (cost=0.00..636676233.38 rows=20353804801 width=31)
Filter: (flag = '0000000000000000'::bit(16))
Konstantin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: hombit@gmail.com, thomas.munro@gmail.com, bugs@gnu.support
Subject: Re: PGSQL 11.4: shared_buffers and /dev/shm size
In-Reply-To: <2A639837-888D-474F-AE91-8BBB65952D70@gmail.com>
References: <7E4D7DA4-E093-4F6A-AE8E-81A73B995A8D@gmail.com> <20190709095344.GK7323@protected.rcdrun.com> <63682227-874F-43A9-8879-DE875DE9BCC3@gmail.com> <20190709101514.GB10233@protected.rcdrun.com> <CA+hUKGJOj7qzDLxeFPVvto8YEWop6FSQoTYPO9Z6Ee=i-nPS_Q@mail.gmail.com> <825554F8-7D18-4DFA-B01F-5F3A47A66749@gmail.com> <CA+hUKGJJPpOcCX946DEFr+uTf4KO22k=ppBL=9BHi=CyL_=unQ@mail.gmail.com> <2A639837-888D-474F-AE91-8BBB65952D70@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox