Re: Out of memory error in 8.1.0 Win32 - Mailing list pgsql-general

From Greg Stark
Subject Re: Out of memory error in 8.1.0 Win32
Date
Msg-id 87r71h10lf.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: Out of memory error in 8.1.0 Win32  ("Todd A. Cook" <tcook@blackducksoftware.com>)
List pgsql-general
"Todd A. Cook" <tcook@blackducksoftware.com> writes:

"Todd A. Cook" <tcook@blackducksoftware.com> writes:

>                                 QUERY PLAN
> -------------------------------------------------------------------------
>   HashAggregate  (cost=1163446.13..1163448.63 rows=200 width=4)
>     ->  Seq Scan on oom_tab  (cost=0.00..867748.42 rows=59139542 width=4)
>
> The row estimitate for oom_tab is close to the actual value.  Most of
> the values are unique, however, so the result should have around 59M
> rows too.

ouch. it's estimating 200 distinct values. The estimates for distinct values
are known to be unreliable but they shouldn't be *that* bad. Do you have a few
hundred extremely common values and then a few million other values?

What does this say:

select * from pg_statistic where starelid = (select oid from pg_class where relname = 'oom_tab')

You may need to reanalyze and maybe increase the statistics target
(possibly by a lot). It may be interesting to compare the results of the above
query before and after analyzing too.

--
greg

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Out of memory error in 8.1.0 Win32
Next
From: Michael Fuhr
Date:
Subject: Re: OT: publicly available databases?