Re: Excessive memory usage in multi-statement queries w/ partitioning - Mailing list pgsql-hackers

From David Rowley
Subject Re: Excessive memory usage in multi-statement queries w/ partitioning
Date
Msg-id CAKJS1f_aY0Vka-TpAMoL366-npbZddRSZfXACk=jf+N0cRszhg@mail.gmail.com
Whole thread Raw
In response to Excessive memory usage in multi-statement queries w/ partitioning  (Andreas Seltenreich <andreas.seltenreich@credativ.de>)
Responses Re: Excessive memory usage in multi-statement queries w/partitioning
List pgsql-hackers
On Thu, 23 May 2019 at 17:55, Andreas Seltenreich
<andreas.seltenreich@credativ.de> wrote:
> a customer reported excessive memory usage and out-of-memory ERRORs
> after introducing native partitioning in one of their databases.  We
> could narrow it down to the overhead introduced by the partitioning when
> issuing multiple statements in a single query.

"multiple statements in a single query", did you mean to write session
or maybe transaction there?

Which version?

I tried your test case with REL_11_STABLE and I see nowhere near as
much memory used in MessageContext.

After repeating the query twice, I see:

MessageContext: 8388608 total in 11 blocks; 3776960 free (1 chunks);
4611648 used
Grand total: 8388608 bytes in 11 blocks; 3776960 free (1 chunks); 4611648 used
MessageContext: 8388608 total in 11 blocks; 3776960 free (1 chunks);
4611648 used
Grand total: 8388608 bytes in 11 blocks; 3776960 free (1 chunks); 4611648 used

which is quite a long way off the 252MB you're getting.

perhaps I'm not testing with the same version as you are.


--
 David Rowley                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Kyotaro HORIGUCHI
Date:
Subject: Re: [HACKERS] WAL logging problem in 9.4.3?
Next
From: Andrew Gierth
Date:
Subject: Re: Why could GEQO produce plans with lower costs than the standard_join_search?