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 3440BD9C43; Thu, 29 Sep 2005 14:07:12 -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 93415-04; Thu, 29 Sep 2005 17:07:09 +0000 (GMT) Received: from mail.mi8.com (d01gw04.mi8.com [63.240.6.44]) by svr1.postgresql.org (Postfix) with ESMTP id 3BB1ED9C6B; Thu, 29 Sep 2005 14:07:08 -0300 (ADT) Received: from 172.16.1.118 by mail.mi8.com with ESMTP (- Welcome to Mi8 Corporation www.Mi8.com (D4)); Thu, 29 Sep 2005 13:06:54 -0400 X-Server-Uuid: C8FB4D43-1108-484A-A898-3CBCC7906230 Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.175]) by d01smtp03.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Thu, 29 Sep 2005 13:06:53 -0400 Received: from 67.103.45.218 ([67.103.45.218]) by MI8NYCMAIL06.Mi8.com ( [172.16.1.219]) via Exchange Front-End Server mi8owa.mi8.com ( [172.16.1.104]) with Microsoft Exchange Server HTTP-DAV ; Thu, 29 Sep 2005 13:06:53 -0500 User-Agent: Microsoft-Entourage/11.2.0.050811 Date: Thu, 29 Sep 2005 10:06:52 -0700 Subject: Re: [PERFORM] A Better External Sort? From: "Luke Lonergan" To: "Josh Berkus" , "Jeffrey W. Baker" Cc: "Ron Peacetree" , pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org Message-ID: Thread-Topic: [HACKERS] [PERFORM] A Better External Sort? Thread-Index: AcXFGC+xbkyDzDELEdq3eAANk63kWA== In-Reply-To: <433C1C2D.7090908@agliodbs.com> MIME-Version: 1.0 X-OriginalArrivalTime: 29 Sep 2005 17:06:53.0999 (UTC) FILETIME=[30E2E3F0:01C5C518] X-WSS-ID: 6F22C0A434O1934798-01-01 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.574 required=5 tests=[AWL=-0.007, FORGED_RCVD_HELO=0.05, RCVD_NUMERIC_HELO=1.531] X-Spam-Level: * X-Archive-Number: 200509/1379 X-Sequence-Number: 73776 Josh, On 9/29/05 9:54 AM, "Josh Berkus" wrote: > Following an index creation, we see that 95% of the time required is the > external sort, which averages 2mb/s. This is with seperate drives for > the WAL, the pg_tmp, the table and the index. I've confirmed that > increasing work_mem beyond a small minimum (around 128mb) had no benefit > on the overall index creation speed. Yuuuup! That about sums it up - regardless of taking 1 or 2 passes through the heap being sorted, 1.5 - 2 MB/s is the wrong number. This is not necessarily an algorithmic problem, but is a optimization problem with Postgres that must be fixed before it can be competitive. We read/write to/from disk at 240MB/s and so 2 passes would run at a net rate of 120MB/s through the sort set if it were that efficient. Anyone interested in tackling the real performance issue? (flame bait, but for a worthy cause :-) - Luke