Re: postmaster growing to consume all memory

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Lincoln Yeoh <lyeoh(at)pop(dot)jaring(dot)my>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: postmaster growing to consume all memory
Date: 2004-01-27 11:07:04
Message-ID: 20040127110704.GC7128@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jan 27, 2004 at 06:48:49PM +0800, Lincoln Yeoh wrote:
> There appear to be 1391110 distinct IPs (using 7.3.4). I did a vacuum full
> analyze when on 7.4 after loading the data tho.
>
> What is supposed to happen if the planner guesses right?

Aah, it seems the statistics were *way* off. It was using the new
HashAggregate code which is more efficient than the Aggregate/Group/Sort
combo when there are a small number of groups. When there are a large number
it takes a lot of memory and gets pretty slow.

I'm afraid I'll have to defer to someone else (Tom?) as why the estimate was
out by three orders of magnitude.

I'd suggest playing around with statistics and seeing if you can work out
why they were so bad.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> (... have gone from d-i being barely usable even by its developers
> anywhere, to being about 20% done. Sweet. And the last 80% usually takes
> 20% of the time, too, right?) -- Anthony Towns, debian-devel-announce

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message lnd 2004-01-27 11:18:37 Increase stored proc. parameters max count
Previous Message Lincoln Yeoh 2004-01-27 10:48:49 Re: postmaster growing to consume all memory