Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E7D62632749 for ; Thu, 5 Aug 2010 12:18:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 62912-09 for ; Thu, 5 Aug 2010 15:18:42 +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 CAE6D6326ED for ; Thu, 5 Aug 2010 12:18:41 -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 o75FIfPZ002098; Thu, 5 Aug 2010 11:18:41 -0400 (EDT) To: Silvio Brandani cc: Kevin Grittner , pgsql-admin@postgresql.org Subject: Re: out of memory error In-reply-to: <4C5ACAD1.8030703@tech.sdb.it> References: <4C5AB62E.7020201@tech.sdb.it> <4C5A7E630200002500034238@gw.wicourts.gov> <931.1281017723@sss.pgh.pa.us> <4C5ACAD1.8030703@tech.sdb.it> Comments: In-reply-to Silvio Brandani message dated "Thu, 05 Aug 2010 16:29:37 +0200" Date: Thu, 05 Aug 2010 11:18:41 -0400 Message-ID: <2097.1281021521@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/21 X-Sequence-Number: 35270 Silvio Brandani writes: >> "Kevin Grittner" writes: >>> What query? [ query with aggregates and GROUP BY ] Does EXPLAIN show that it's trying to use a hash aggregation plan? If so, try turning off enable_hashagg. I think the hash table might be ballooning far past the number of entries the planner expected. Do you have an idea how many groups there should be in the query result? regards, tom lane