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 A132BD9CB8; Fri, 30 Sep 2005 17:39:17 -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 86511-04; Fri, 30 Sep 2005 20:39:14 +0000 (GMT) Received: from mail.Mi8.com (d01gw01.mi8.com [63.240.6.47]) by svr1.postgresql.org (Postfix) with ESMTP id 12CFCD97E0; Fri, 30 Sep 2005 17:39:14 -0300 (ADT) Received: from 172.16.1.118 by mail.Mi8.com with ESMTP (- Welcome to Mi8 Corporation www.Mi8.com (D1)); Fri, 30 Sep 2005 16:38:58 -0400 X-Server-Uuid: 241911D6-425B-44B9-A073-E3FE0F8FC774 Received: from MI8NYCMAIL06.Mi8.com ([172.16.1.175]) by d01smtp03.Mi8.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 30 Sep 2005 16:38:57 -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 ; Fri, 30 Sep 2005 16:38:57 -0500 User-Agent: Microsoft-Entourage/11.2.0.050811 Date: Fri, 30 Sep 2005 13:38:54 -0700 Subject: Re: [PERFORM] A Better External Sort? From: "Luke Lonergan" To: "Ron Peacetree" , "Josh Berkus" , pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org Message-ID: Thread-Topic: [HACKERS] [PERFORM] A Better External Sort? Thread-Index: AcXF/vkCN7B83DHyEdqX9QANk63kWA== In-Reply-To: <31833713.1128111650174.JavaMail.root@elwamui-polski.atl.sa.earthlink.net> MIME-Version: 1.0 X-OriginalArrivalTime: 30 Sep 2005 20:38:57.0804 (UTC) FILETIME=[FB4734C0:01C5C5FE] X-WSS-ID: 6F237DEB4IO122685-02-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/1425 X-Sequence-Number: 73822 Ron, On 9/30/05 1:20 PM, "Ron Peacetree" wrote: > That 11MBps was your =bulk load= speed. If just loading a table > is this slow, then there are issues with basic physical IO, not just > IO during sort operations. Bulk loading speed is irrelevant here - that is dominated by parsing, which we have covered copiously (har har) previously and have sped up by 500%, which still makes Postgres < 1/2 the loading speed of MySQL. > As I said, the obvious candidates are inefficient physical layout > and/or flawed IO code. Yes. > Until the basic IO issues are addressed, we could replace the > present sorting code with infinitely fast sorting code and we'd > still be scrod performance wise. Postgres' I/O path has many problems that must be micro-optimized away. Too small of an operand size compared to disk caches, memory, etc etc are the common problem. Another is lack of micro-parallelism (loops) with long enough runs to let modern processors pipeline and superscale. The net problem here is that a simple "select blah from blee order by(blah.a);" runs at 1/100 of the sequential scan rate. - Luke