Re: Backend crash with user defined aggregate

From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Backend crash with user defined aggregate
Date: 2005-09-24 05:36:50
Message-ID: 4334E5F2.8030702@cheapcomplexdevices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com> writes:
>>...aggregate function that concatenates
>>any non-null strings it encounters...crashes...
>
> I tried this example in CVS tip and didn't see any particular misbehavior.

One thing is that my table is quite large (20 GB or so of data in that
table with most of it in that column called 'val' being aggregated).
When I try it on small tables (100k rows) I get no problems.

> What PG version are you running?

fli=# select version();
version
-------------------------------------------------------------------------------------
PostgreSQL 8.0.2 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.3.3 (SuSE Linux)
(1 row)

> Does EXPLAIN show that the query is
> being done with a group or hash aggregation?

Fails the same way in each case. It was doing a HashAggregate last time; but
I just reproduced it now with a GroupAggregate.

fli=#
fli=# explain select ext_doc_id,strcat_agg(nam)||+strcat_agg(val) from facet_raw group by ext_doc_id;
QUERY PLAN
---------------------------------------------------------------------------
HashAggregate (cost=216543.88..216737.30 rows=9671 width=46)
-> Seq Scan on facet_raw (cost=0.00..118746.32 rows=5588432 width=46)
(2 rows)

fli=# set enable_hashagg = false;
SET
fli=# explain select ext_doc_id,strcat_agg(nam)||+strcat_agg(val) from facet_raw group by ext_doc_id;
QUERY PLAN
---------------------------------------------------------------------------------
GroupAggregate (cost=951426.23..1063388.29 rows=9671 width=46)
-> Sort (cost=951426.23..965397.31 rows=5588432 width=46)
Sort Key: ext_doc_id
-> Seq Scan on facet_raw (cost=0.00..118746.32 rows=5588432 width=46)
(4 rows)

fli=# explain analyze select ext_doc_id,strcat_agg(nam)||+strcat_agg(val) from facet_raw group by ext_doc_id;
FATAL: terminating connection due to administrator command
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
fli=#

> What do you have sort_mem set to?

fli=# show sort_mem;
work_mem
----------
51829
(1 row)

fli=#

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oleg Bartunov 2005-09-24 06:09:32 Re: tsearch2 for alphabetic character strings & codes
Previous Message Michael Fuhr 2005-09-24 04:07:58 Re: question about to return two diferent tables from a function