Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 9F8886337FA for ; Tue, 17 Aug 2010 10:45:06 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 57630-06 for ; Tue, 17 Aug 2010 13:44:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 4E59063249C for ; Tue, 17 Aug 2010 10:44:59 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o7HDivjZ009281; Tue, 17 Aug 2010 09:44:57 -0400 (EDT) To: edoardo.innocenti@savinodelbene.com cc: pgsql-admin@postgresql.org Subject: Re: TopMemoryContext - Configuration Mistake? In-reply-to: <4C6A32F8.1070808@savinodelbene.com> References: <4C6932DF.90102@savinodelbene.com> <5923.1281974354@sss.pgh.pa.us> <4C6A32F8.1070808@savinodelbene.com> Comments: In-reply-to Edoardo Innocenti message dated "Tue, 17 Aug 2010 08:58:00 +0200" Date: Tue, 17 Aug 2010 09:44:57 -0400 Message-ID: <9280.1282052697@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201008/128 X-Sequence-Number: 35377 Edoardo Innocenti writes: > Query Plan:
> "HashAggregate (cost=4910.06..4910.19 rows=1 width=659)" Hm ... the planner seems to think that this is a small query that isn't going to take long, which is a bit at odds with the fact that you're running out of memory. I suspect that these rowcount estimates are far too low, which would suggest that you need to make sure your ANALYZE statistics are up-to-date, and perhaps raise the statistics targets. Try to get the plan's estimated rowcounts to approximate reality. BTW, you might want to think about turning off your mail program's HTML option. What other people are seeing looks like this: http://archives.postgresql.org/pgsql-admin/2010-08/msg00126.php and it's not pretty. regards, tom lane