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 87945D9E27; Mon, 3 Oct 2005 17:36:38 -0300 (ADT) 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 30440-01; Mon, 3 Oct 2005 20:36:35 +0000 (GMT) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by svr1.postgresql.org (Postfix) with ESMTP id CB23BD9E0E; Mon, 3 Oct 2005 17:36:36 -0300 (ADT) X-EthosMedia-Virus-Scanned: no infections found Received: from [64.81.245.111] (account josh@agliodbs.com HELO temoku.sf.agliodbs.com) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 8192127; Mon, 03 Oct 2005 13:39:02 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Tom Lane Subject: Re: [HACKERS] A Better External Sort? Date: Mon, 3 Oct 2005 13:40:29 -0700 User-Agent: KMail/1.8 Cc: "Jeffrey W. Baker" , Ron Peacetree , pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org References: <21402654.1127923414088.JavaMail.root@elwamui-polski.atl.sa.earthlink.net> <433C1C2D.7090908@agliodbs.com> <8643.1128181455@sss.pgh.pa.us> In-Reply-To: <8643.1128181455@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510031340.29376.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.046 required=5 tests=[AWL=-0.004, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/25 X-Sequence-Number: 14793 Tom, > Raising work_mem to a gig should result in about five runs, needing only > one pass, which is really going to be as good as it gets. If you could > not see any difference then I see little hope for the idea that reducing > the number of merge passes will help. Right. It *should have*, but didn't seem to. Example of a simple sort test of 100 million random-number records 1M 3294 seconds 16M 1107 seconds 256M 1209 seconds 512M 1174 seconds 512M with 'not null' for column that is indexed 1168 seconds > Umm ... you were raising maintenance_work_mem, I trust, not work_mem? Yes. > > We really need to get some hard data about what's going on here. The > sort code doesn't report any internal statistics at the moment, but it > would not be hard to whack together a patch that reports useful info > in the form of NOTICE messages or some such. Yeah, I'll do this as soon as the patch is finished. Always useful to gear up the old TPC-H. -- --Josh Josh Berkus Aglio Database Solutions San Francisco