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 922119DCB4E for ; Wed, 15 Feb 2006 11:56: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 51010-04 for ; Wed, 15 Feb 2006 11:56:09 -0400 (AST) X-Greylist: whitelisted by SQLgrey- Received: from smtp1-g19.free.fr (smtp1-g19.free.fr [212.27.42.27]) by postgresql.org (Postfix) with ESMTP id 571489DCB34 for ; Wed, 15 Feb 2006 11:56:02 -0400 (AST) Received: from imp2-g19.free.fr (imp2-g19.free.fr [212.27.42.2]) by smtp1-g19.free.fr (Postfix) with ESMTP id AE55969231 for ; Wed, 15 Feb 2006 16:56:07 +0100 (CET) Received: by imp2-g19.free.fr (Postfix, from userid 33) id 971A17AD3C; Wed, 15 Feb 2006 16:56:07 +0100 (MET) Received: from wormhole.x-echo.com (wormhole.x-echo.com [193.252.148.11]) by imp2-g19.free.fr (IMP) with HTTP for ; Wed, 15 Feb 2006 16:56:07 +0100 Message-ID: <1140018967.43f34f1761803@imp2-g19.free.fr> Date: Wed, 15 Feb 2006 16:56:07 +0100 From: martial.bizel@free.fr To: pgsql-performance@postgresql.org Subject: Re: explain hashAggregate References: <20060215090446.2F3AC1B819F@mx1.hub.org> <1140018387.43f34cd36a076@imp2-g19.free.fr> In-Reply-To: <1140018387.43f34cd36a076@imp2-g19.free.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.5 X-Originating-IP: 193.252.148.11 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.654 required=5 tests=[AWL=0.104, NO_REAL_NAME=0.55] X-Spam-Score: 0.654 X-Spam-Level: X-Archive-Number: 200602/199 X-Sequence-Number: 17185 Good morning, I try to understand how optimizer uses HashAggregate instead of GroupAggregate and I want to know what is exactly this two functionnality (benefits /inconvenients) In my case, I've this 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) ---------------------------- How to get necessary memory RAM for this explain plan ? thanks a lot