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

From Hitoshi Harada
Subject Re: [BUGS] BUG #5608: array_agg() consumes too much memory
Date
Msg-id AANLkTi=eSLVAu0ZeuO9fBxiA1L0Z6RL24pPV6YMbdZ7D@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #5608: array_agg() consumes too much memory  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
Responses Re: [BUGS] BUG #5608: array_agg() consumes too much memory  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [BUGS] BUG #5608: array_agg() consumes too much memory  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
2010/8/14 Itagaki Takahiro <itagaki.takahiro@gmail.com>:
> 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.

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?

Regards,

-- 
Hitoshi Harada


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Recognize functional dependency on primary keys.
Next
From: Boszormenyi Zoltan
Date:
Subject: Re: WIP partial replication patch