X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 2625E9DCC19 for ; Wed, 15 Feb 2006 12:51:04 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 59861-10-2 for ; Wed, 15 Feb 2006 12:51:02 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id F39929DCC0D for ; Wed, 15 Feb 2006 12:50:58 -0400 (AST) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Wed, 15 Feb 2006 16:50:57 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 15 Feb 2006 10:50:57 -0600 Subject: Re: out of memory From: Scott Marlowe To: martial.bizel@free.fr Cc: pgsql-performance@postgresql.org In-Reply-To: <1140018930.43f34ef260de0@imp2-g19.free.fr> References: <1140018930.43f34ef260de0@imp2-g19.free.fr> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1140022257.22740.225.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 15 Feb 2006 10:50:57 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.162 required=5 tests=[AWL=0.161, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 0.162 X-Spam-Level: X-Archive-Number: 200602/202 X-Sequence-Number: 17188 On Wed, 2006-02-15 at 09:55, martial.bizel@free.fr wrote: > Good morning, > > > > > I've increased sort_mem until 2Go !! > and the error "out of memory" appears again. > > Here the request I try to pass with her explain plan, > > Nested Loop (cost=2451676.23..2454714.73 rows=1001 width=34) > -> Subquery Scan "day" (cost=2451676.23..2451688.73 rows=1000 width=16) > -> Limit (cost=2451676.23..2451678.73 rows=1000 width=12) > -> Sort (cost=2451676.23..2451684.63 rows=3357 width=12) > Sort Key: sum(occurence) > -> HashAggregate (cost=2451471.24..2451479.63 rows=3357 > width=12) > -> Index Scan using test_date on > queries_detail_statistics (cost=0.00..2449570.55 rows=380138 width=12) > Index Cond: ((date >= '2006-01-01'::date) AND > (date <= '2006-01-30'::date)) > Filter: (((portal)::text = '1'::text) OR > ((portal)::text = '2'::text)) > -> Index Scan using query_string_pkey on query_string (cost=0.00..3.01 > rows=1 width=34) > Index Cond: ("outer".query = query_string.id) > (11 rows) OK, so it looks like something is horrible wrong here. Try running the explain analyze query after running the following: set enable_hashagg=off; and see what you get then.