Re: Out of memory error during large hashagg - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Out of memory error during large hashagg
Date
Msg-id 28692.1159049864@sss.pgh.pa.us
Whole thread Raw
In response to Out of memory error during large hashagg  (Casey Duncan <casey@pandora.com>)
Responses Re: Out of memory error during large hashagg
List pgsql-bugs
Casey Duncan <casey@pandora.com> writes:
> select st_id, min(seed_id) as "initial_seed_id", count(*) as
> "seed_count" from seed group by st_id;

> The query plan and table stats are:

>                                QUERY PLAN
> -----------------------------------------------------------------------
> HashAggregate  (cost=1362694.83..1365164.68 rows=164656 width=16)
>     ->  Seq Scan on seed  (cost=0.00..964065.62 rows=53150562 width=16)

How many distinct st_id values are there really?  The planner's
evidently expecting 164656 but I suppose that's wrong?  What's
in pg_stats for st_id?

            regards, tom lane

pgsql-bugs by date:

Previous
From: Victor Snezhko
Date:
Subject: Re: Corruption of multibyte identifiers on UTF-8 locale
Next
From: Casey Duncan
Date:
Subject: Re: Out of memory error during large hashagg