Skip site navigation (1) Skip section navigation (2)

Re: BUG #5608: array_agg() consumes too much memory

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com>
Cc: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: BUG #5608: array_agg() consumes too much memory
Date: 2010-08-14 15:49:46
Message-ID: 29240.1281800986@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
Hitoshi Harada <umi(dot)tanuki(at)gmail(dot)com> writes:
> 2010/8/14 Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>:
>> The attached patch is the near-term fix; it adds ALLOCSET_DEFAULT_INITSIZE
>> bytes to memory assumption.
>> 
>> We might need the same adjustment for string_agg(), that consumes
>> 1024 bytes for the transit condition. array_agg() and string_agg()
>> are only aggregates that have "internal" for aggtranstype.

> So, is it better to generalize as it adds ALLOCSET_DEFAULT_INITSIZE if
> the transtype is internal, rather than specifying individual function
> OID as the patch stands?

I've applied a patch following Hitoshi-san's idea.

BTW, a note about the upthread patch: we don't do manual #define's for
OIDs in pg_proc.h.  Use fmgroids.h for that.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-08-14 16:08:41
Subject: Re: Python 2.7 deprecated the PyCObject API?
Previous:From: Tom LaneDate: 2010-08-14 14:09:04
Subject: Re: review: psql: edit function, show function commands patch

pgsql-bugs by date

Next:From: Tom LaneDate: 2010-08-15 18:58:10
Subject: DropRelFileNodeBuffers API change (was Re: [BUGS] BUG #5599: Vacuum fails due to index corruption issues)
Previous:From: Tom LaneDate: 2010-08-14 13:30:49
Subject: Re: BUG #5608: array_agg() consumes too much memory

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group