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

2010-08-14 Thread Tom Lane
Hitoshi Harada writes: > 2010/8/14 Itagaki Takahiro : >> 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 strin

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

2010-08-14 Thread Tom Lane
Hitoshi Harada writes: > 2010/8/14 Itagaki Takahiro : >> 2010/8/10 Tom Lane : >>> 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 >>> co

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

2010-08-13 Thread Hitoshi Harada
2010/8/14 Itagaki Takahiro : > 2010/8/10 Tom Lane : >> 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(). > > T

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

2010-08-13 Thread Itagaki Takahiro
2010/8/10 Tom Lane : > 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

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

2010-08-09 Thread Tom Lane
"Itagaki Takahiro" writes: > I encountered "out of memory" error in large > GROUP BY query with array_agg(). The server log > was filled by the following messages: > accumArrayResult: 8192 total in 1 blocks; 7800 free (0 chunks); 392 > used > Should we choose smaller size of initial memory i

[BUGS] BUG #5608: array_agg() consumes too much memory

2010-08-09 Thread Itagaki Takahiro
The following bug has been logged online: Bug reference: 5608 Logged by: Itagaki Takahiro Email address: itagaki.takah...@gmail.com PostgreSQL version: 9.0beta4 Operating system: Windows 7 (32bit) Description:array_agg() consumes too much memory Details: I encounter