Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VZGxq-0004y3-TQ for pgsql-bugs@arkaria.postgresql.org; Thu, 24 Oct 2013 09:12:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VZGxq-0008NU-B7 for pgsql-bugs@arkaria.postgresql.org; Thu, 24 Oct 2013 09:12:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VZGxp-0008NN-Bd for pgsql-bugs@postgresql.org; Thu, 24 Oct 2013 09:12:21 +0000 Received: from d4b26f12.static.ziggozakelijk.nl ([212.178.111.18] helo=storagefox.foxi.nl) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VZGxl-0006Ko-U1 for pgsql-bugs@postgresql.org; Thu, 24 Oct 2013 09:12:21 +0000 Received: from techfox.foxi (techfox.foxi [192.168.0.31]) by storagefox.foxi.nl (8.14.5/8.14.5) with ESMTP id r9O9CF6m011534; Thu, 24 Oct 2013 11:12:15 +0200 From: Frank van Vugt To: pgsql-bugs@postgresql.org Cc: Valentine Gogichashvili , ftm.van.vugt@foxi.nl Subject: Re: array_agg() on a set larger than some arbitrary(?) limit causes runaway memory usage and eventually memory exhaustion Date: Thu, 24 Oct 2013 11:12:14 +0200 Message-ID: <3716683.icChMuMX1C@techfox.foxi> Organization: Foxi Group User-Agent: KMail/4.10.5 (Linux/3.7.10-1.16-desktop; KDE/4.10.5; x86_64; ; ) In-Reply-To: References: <3839201.Nfa2RvcheX@techfox.foxi> <2334937.gaPyc11YQv@techfox.foxi> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="nextPart3808332.6Cz43Gvzx1" Content-Transfer-Encoding: 7Bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is a multi-part message in MIME format. --nextPart3808332.6Cz43Gvzx1 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Hi Valentine, Op zondag 20 oktober 2013 14:06:19 schreef Valentine Gogichashvili: Apropos, how does the string_agg aggregate behave in your example? Will be nice to know without experimenting myself and looking into the sources :) Interesting.... On the 1e7 dataset, our custom comcat() function runs for ~18.5 seconds and eats up to ~6,5 GB of memory, while the string_agg() on the same dataset runs for ~23.5 seconds and eats up to ~16 GB of memory. -- Best, Frank. --nextPart3808332.6Cz43Gvzx1 Content-Transfer-Encoding: 7Bit Content-Type: text/html; charset="us-ascii"

Hi Valentine,

 

Op zondag 20 oktober 2013 14:06:19 schreef Valentine Gogichashvili:

Apropos, how does the string_agg aggregate behave in your example? Will be nice to know without experimenting myself and looking into the sources :)

Interesting....

 

On the 1e7 dataset, our custom comcat() function runs for ~18.5 seconds and eats up to ~6,5 GB of memory, while the string_agg() on the same dataset runs for ~23.5 seconds and eats up to ~16 GB of memory.

 

 

 

 

--

 

Best,

 

 

 

 

Frank.

 

--nextPart3808332.6Cz43Gvzx1--