Re: [BUGS] BUG #5608: array_agg() consumes too much memory - Mailing list pgsql-hackers

From Itagaki Takahiro
Subject Re: [BUGS] BUG #5608: array_agg() consumes too much memory
Date
Msg-id AANLkTin2=0XFw8JDt5UbpkrL_kdfrLQzsnA0zZ+d2VZL@mail.gmail.com
Whole thread Raw
Responses Re: [BUGS] BUG #5608: array_agg() consumes too much memory  (Hitoshi Harada <umi.tanuki@gmail.com>)
List pgsql-hackers
2010/8/10 Tom Lane <tgl@sss.pgh.pa.us>:
> Eventually it might be nice to have some sort of way to specify the
> estimate to use for any aggregate function --- but for a near-term
> fix maybe we should just hard-wire a special case for array_agg in
> count_agg_clauses_walker().

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.

--
Itagaki Takahiro

Attachment

pgsql-hackers by date:

Previous
From: James William Pye
Date:
Subject: Re: Python 2.7 deprecated the PyCObject API?
Next
From: Bruce Momjian
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.