X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A0EA0D7D42 for ; Wed, 9 Nov 2005 13:13:56 -0400 (AST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 05151-04 for ; Wed, 9 Nov 2005 17:13:55 +0000 (GMT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.116.145.2]) by svr1.postgresql.org (Postfix) with ESMTP id 924B4D79D9 for ; Wed, 9 Nov 2005 13:13:54 -0400 (AST) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id B324931058; Wed, 9 Nov 2005 18:13:51 +0100 (MET) From: Charlie Savage X-Newsgroups: pgsql.performance Subject: Re: Sort performance on large tables Date: Wed, 09 Nov 2005 10:13:46 -0700 Organization: Hub.Org Networking Services Lines: 29 Message-ID: <43722E4A.8060904@interserv.com> References: <43704E1D.80708@interserv.com> <1131528955.8300.2101.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org To: Simon Riggs User-Agent: Thunderbird 1.5 (Windows/20051025) In-Reply-To: <1131528955.8300.2101.camel@localhost.localdomain> To: pgsql-performance@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200511/158 X-Sequence-Number: 15415 Hi Simon, Thanks for the response Simon. > PostgreSQL can do HashAggregates as well as GroupAggregates, just like > Oracle. HashAggs avoid the sort phase, so would improve performance > considerably. The difference in performance you are getting is because > of the different plan used. Did you specifically do anything to Oracle > to help it get that plan, or was it a pure out-of-the-box install (or > maybe even a "set this up for Data Warehousing" install)? It was an out-of-the-box plan with the standard database install option (wasn't a Data Warehousing install). > Can you let us know how high you have to set work_mem before an EXPLAIN > (not EXPLAIN ANALYZE) chooses the HashAgg plan? The planner picked a HashAggregate only when I set work_mem to 2097151 - which I gather is the maximum allowed value according to a message returned from the server. > Please be aware that publishing Oracle performance results is against > the terms of their licence and we seek to be both fair and legitimate, > especially within this public discussion forum. Sorry, I didn't realize - I'll be more vague next time. Charlie