pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Out of memory error with PG10.3, 10.4 but not 9.3.19
6+ messages / 4 participants
[nested] [flat]

* Out of memory error with PG10.3, 10.4 but not 9.3.19
@ 2018-05-15 15:02  ChatPristi <cchristo_0899@yahoo.fr>
  0 siblings, 3 replies; 6+ messages in thread

From: ChatPristi @ 2018-05-15 15:02 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Dear all,

I have a SELECT command (in partitionned tables) that failed with:psql:/tmp/query.txt:1: ERROR:  out of memory
DETAIL:  Cannot enlarge string buffer containing 1073741818 bytes by 32 more bytes.

I got the error with PG 10.3 and 10.4 on CentOS 7 up-to-date.The command works with a smaller size database.
The command works with the same database with PG 9.3.19 on RHEL 6.9 up-to-date.

I attach the EXPLAIN SELECT command.

Apart rewriting the query is there any parameter that could be changed to make the query work in the postgresql.conf ?
Thank you very much for any help.

Attachments:

  explain.txt.zip (application/zip, 2.7M) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Out of memory error with PG10.3, 10.4 but not 9.3.19
@ 2018-05-16 08:48  Michael Paquier <michael@paquier.xyz>
  parent: ChatPristi <cchristo_0899@yahoo.fr>
  2 siblings, 1 reply; 6+ messages in thread

From: Michael Paquier @ 2018-05-16 08:48 UTC (permalink / raw)
  To: ChatPristi <cchristo_0899@yahoo.fr>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On Tue, May 15, 2018 at 03:02:48PM +0000, ChatPristi wrote:
> I got the error with PG 10.3 and 10.4 on CentOS 7 up-to-date.The
> command works with a smaller size database. 
> The command works with the same database with PG 9.3.19 on RHEL 6.9
> up-to-date.
> 
> I attach the EXPLAIN SELECT command.

Well, instead of an explain output which takes 2.4MB compressed and
9.6MB uncompressed (take it as unreadable), could you produce a
self-contained test case with a glimpse of the schema you are using?
Where does the OOM happen, and how did you change your partitioned table
schema?  Are you using the native partitioning instead?
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Out of memory error with PG10.3, 10.4 but not 9.3.19
@ 2018-05-18 10:25  Peter J. Holzer <hjp-pgsql@hjp.at>
  parent: ChatPristi <cchristo_0899@yahoo.fr>
  2 siblings, 1 reply; 6+ messages in thread

From: Peter J. Holzer @ 2018-05-18 10:25 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

On 2018-05-15 15:02:48 +0000, ChatPristi wrote:
> I have a SELECT command (in partitionned tables) that failed with:
> psql:/tmp/query.txt:1: ERROR:  out of memory
> DETAIL:  Cannot enlarge string buffer containing 1073741818 bytes by 32 more
> bytes.

1073741818 is a bit less than 1GB and 1073741818+32 is a bit more. So
you are obviously hitting a 1GB limit here.

Given that 1GB is the maximum length of a character type value in
PostgreSQL and the error message mentions a "string buffer", I suspect
that your query tries to construct a very long string. Try to rewrite
the query so that it creates several shorter strings instead.

        hp




-- 
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp@hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/;

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Fw: Re: Out of memory error with PG10.3, 10.4 but not 9.3.19
@ 2018-06-06 20:08  ChatPristi <cchristo_0899@yahoo.fr>
  parent: Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 6+ messages in thread

From: ChatPristi @ 2018-06-06 20:08 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

 Forgotten to CC the list, sorry...

>Well, instead of an explain output which takes 2.4MB compressed and
>9.6MB uncompressed (take it as unreadable), could you produce a
>self-contained test case with a glimpse of the schema you are using?
>Where does the OOM happen, and how did you change your partitioned table
>schema?  Are you using the native partitioning instead?
>Michael,
Thank you for your answer.

Sorry for the unreadable explain output.
I attached a SQL dump with 2 entities loaded in the database (2,872,265 entities in the actual database), the actual query and the actual output.

The OOM is durin the query (SELECT) after ~9 minutes the memory of the postgres increase until 8GB and the OOM message.

Partitioning is done by inherhitance.
After a complete reload of the database in PG10.4 the OOM still exists.


--
Michael    

Attachments:

  Archive.zip (application/zip, 67.2K) download

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Fw: Re: Out of memory error with PG10.3, 10.4 but not 9.3.19
@ 2018-06-06 20:30  ChatPristi <cchristo_0899@yahoo.fr>
  parent: Peter J. Holzer <hjp-pgsql@hjp.at>
  0 siblings, 0 replies; 6+ messages in thread

From: ChatPristi @ 2018-06-06 20:30 UTC (permalink / raw)
  To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>

 
Forgotten to CC the list too, sorry. again..
  >1073741818 is a bit less than 1GB and 1073741818+32 is a bit more. So
>you are obviously hitting a 1GB limit here.
>Given that 1GB is the maximum length of a character type value in
>PostgreSQL and the error message mentions a "string buffer", I suspect
>that your query tries to construct a very long string. Try to rewrite
>the query so that it creates several shorter strings instead.>      hp

Peter,
Thank you for your answer.I understood tht some buffer limit is reached. But I do not see where.The output is 1513 rows and 78 kb.


-- 
  _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |  | hjp@hjp.at        | management tools.
__/  | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/;    

^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Out of memory error with PG10.3, 10.4 but not 9.3.19
@ 2018-06-12 21:43  Christophe combet <chrisc_pro@yahoo.fr>
  parent: ChatPristi <cchristo_0899@yahoo.fr>
  2 siblings, 0 replies; 6+ messages in thread

From: Christophe combet @ 2018-06-12 21:43 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

 Le mercredi 16 mai 2018 à 09:48:54 UTC+2, ChatPristi <cchristo_0899@yahoo.fr> a écrit :
 
 
 Dear all,

I have a SELECT command (in partitionned tables) that failed with:psql:/tmp/query.txt:1: ERROR:  out of memory
DETAIL:  Cannot enlarge string buffer containing 1073741818 bytes by 32 more bytes.

I got the error with PG 10.3 and 10.4 on CentOS 7 up-to-date.The command works with a smaller size database.
The command works with the same database with PG 9.3.19 on RHEL 6.9 up-to-date.

I attach the EXPLAIN SELECT command.

Apart rewriting the query is there any parameter that could be changed to make the query work in the postgresql.conf ?
Thank you very much for any help.

Hello,
Any ideas where the OOM comes from in 10.4 while 9.3 is working ?

Thanks.

  

^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2018-06-12 21:43 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-05-15 15:02 Out of memory error with PG10.3, 10.4 but not 9.3.19 ChatPristi <cchristo_0899@yahoo.fr>
2018-05-16 08:48 ` Michael Paquier <michael@paquier.xyz>
2018-06-06 20:08   ` ChatPristi <cchristo_0899@yahoo.fr>
2018-05-18 10:25 ` Peter J. Holzer <hjp-pgsql@hjp.at>
2018-06-06 20:30   ` ChatPristi <cchristo_0899@yahoo.fr>
2018-06-12 21:43 ` Christophe combet <chrisc_pro@yahoo.fr>

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