pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: rob stone <floriparob@gmail.com>
To: Yuri Budilov <yuri.budilov@hotmail.com>
To: John R Pierce <pierce@hogranch.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: JSON out of memory error on PostgreSQL 9.6.x
Date: Mon, 04 Dec 2017 11:01:17 +1100
Message-ID: <1512345677.5030.1.camel@gmail.com> (raw)
In-Reply-To: <DM5PR13MB17557D9BE4B9846D16D05405993F0@DM5PR13MB1755.namprd13.prod.outlook.com>
References: <81363279.2185591.1511207314550.ref@mail.yahoo.com>
	<81363279.2185591.1511207314550@mail.yahoo.com>
	<CACqosVSBOQxtCKEipCX=uaf9s6LbDYiCQ__2Het7pzU6pq+smg@mail.gmail.com>
	<CAO32GkCcVOn6kums8mo1hGFHmsKkqoWMxTfD6yk3EmD5e48eZA@mail.gmail.com>
	<CANvgUk4=-Y6bDyc-oMU_pwbxip1iLH1OLVFC-gKR+UjAZMxiGA@mail.gmail.com>
	<6207.1511235609@sss.pgh.pa.us>
	<df175ae4-7522-0ee3-67c0-98b822c5c3e7@hogranch.com>
	<DM5PR13MB17557D9BE4B9846D16D05405993F0@DM5PR13MB1755.namprd13.prod.outlook.com>



On Sun, 2017-12-03 at 23:18 +0000, Yuri Budilov wrote:
> Posted on Stack Overflow, sadly no replies, so trying here....
> 
>  CREATE TABLE X AS
> SELECT json_array_elements(json_rmq -> 'orders'::text) AS order
> FROM table_name
> WHERE blah;
> I get out of memory error.
> 
> Is there anything I can do to unpack the above?
> 
> The JSON column is about ~5 MB and it has about ~150,000 array
> row elements in 'orders' above.
> 
> I tried work_mem values up to ~250MB and it did not help, the query
> takes about same time to fail.
> 
> I guess this parameter does not help JSON processing.
> 
> If there another parameter I can try? Something else?
> 
> I don't have control of the size of the JSON payload, it arrives, we
> store it in a JSON column and then we need to crack it open.
> 
> Many thanks!
> 



Hello,

It would help if you advised:-
(a) version of PostgreSql being used.
(b) is column json_rmq defined as json or jsonb?
(c) OS.

Cheers,
Rob





view thread (10+ messages)  latest in thread

Message-ID: <1512345677.5030.1.camel@gmail.com>
Permalink:  ../1512345677.5030.1.camel@gmail.com/
Also on:    postgresql.org/message-id/1512345677.5030.1.camel@gmail.com

 · 

reply

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: floriparob@gmail.com, yuri.budilov@hotmail.com, pierce@hogranch.com
  Subject: Re: JSON out of memory error on PostgreSQL 9.6.x
  In-Reply-To: <1512345677.5030.1.camel@gmail.com>
  References: <81363279.2185591.1511207314550.ref@mail.yahoo.com> <81363279.2185591.1511207314550@mail.yahoo.com> <CACqosVSBOQxtCKEipCX=uaf9s6LbDYiCQ__2Het7pzU6pq+smg@mail.gmail.com> <CAO32GkCcVOn6kums8mo1hGFHmsKkqoWMxTfD6yk3EmD5e48eZA@mail.gmail.com> <CANvgUk4=-Y6bDyc-oMU_pwbxip1iLH1OLVFC-gKR+UjAZMxiGA@mail.gmail.com> <6207.1511235609@sss.pgh.pa.us> <df175ae4-7522-0ee3-67c0-98b822c5c3e7@hogranch.com> <DM5PR13MB17557D9BE4B9846D16D05405993F0@DM5PR13MB1755.namprd13.prod.outlook.com> <1512345677.5030.1.camel@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