X-Original-To: pgsql-hackers-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B15D1D9C79; Thu, 29 Sep 2005 14:59:40 -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 07799-04; Thu, 29 Sep 2005 17:59:38 +0000 (GMT) Received: from davinci.ethosmedia.com (server227.ethosmedia.com [209.128.84.227]) by svr1.postgresql.org (Postfix) with ESMTP id DD7DAD9C70; Thu, 29 Sep 2005 14:59:38 -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 8173944; Thu, 29 Sep 2005 11:02:03 -0700 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: "Jeffrey W. Baker" Subject: Re: [PERFORM] A Better External Sort? Date: Thu, 29 Sep 2005 11:03:27 -0700 User-Agent: KMail/1.8 Cc: Luke Lonergan , Ron Peacetree , pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org References: <1128015863.11474.9.camel@noodles> In-Reply-To: <1128015863.11474.9.camel@noodles> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200509291103.27344.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.047 required=5 tests=[AWL=-0.003, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/1382 X-Sequence-Number: 73779 Jeff, > Josh, do you happen to know how many passes are needed in the multiphase > merge on your 60GB table? No, any idea how to test that? > I think the largest speedup will be to dump the multiphase merge and > merge all tapes in one pass, no matter how large M. Currently M is > capped at 6, so a sort of 60GB with 1GB sort memory needs 13 passes over > the tape. It could be done in a single pass heap merge with N*log(M) > comparisons, and, more importantly, far less input and output. Yes, but the evidence suggests that we're actually not using the whole 1GB of RAM ... maybe using only 32MB of it which would mean over 200 passes (I'm not sure of the exact match). Just fixing our algorithm so that it used all of the work_mem permitted might improve things tremendously. > I would also recommend using an external processes to asynchronously > feed the tuples into the heap during the merge. > > What's the timeframe for 8.2? Too far out to tell yet. Probably 9mo to 1 year, that's been our history. -- --Josh Josh Berkus Aglio Database Solutions San Francisco