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 E470CD989E; Tue, 27 Sep 2005 14:26:46 -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 61047-02; Tue, 27 Sep 2005 17:26:37 +0000 (GMT) Received: from gghcwest.com (adsl-71-128-90-172.dsl.pltn13.pacbell.net [71.128.90.172]) by svr1.postgresql.org (Postfix) with ESMTP id 254E8D967F; Tue, 27 Sep 2005 14:26:35 -0300 (ADT) Received: from toonses.gghcwest.com (toonses.gghcwest.com [192.168.168.115]) by gghcwest.com (8.12.10/8.12.9) with ESMTP id j8RHQRmd027746; Tue, 27 Sep 2005 10:26:28 -0700 Received: from jwb by toonses.gghcwest.com with local (Exim 4.52) id 1EKJDo-0002N9-Ox; Tue, 27 Sep 2005 10:26:28 -0700 Subject: Re: [PERFORM] A Better External Sort? From: "Jeffrey W. Baker" To: Ron Peacetree Cc: Josh Berkus , pgsql-hackers@postgresql.org, pgsql-performance@postgresql.org In-Reply-To: <6620549.1127841338151.JavaMail.root@elwamui-polski.atl.sa.earthlink.net> References: <6620549.1127841338151.JavaMail.root@elwamui-polski.atl.sa.earthlink.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Tue, 27 Sep 2005 10:26:28 -0700 Message-Id: <1127841988.8965.3.camel@toonses.gghcwest.com> Mime-Version: 1.0 X-Mailer: Evolution 2.4.0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=-0.544 required=5 tests=[AWL=-0.594, FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200509/1245 X-Sequence-Number: 73642 On Tue, 2005-09-27 at 13:15 -0400, Ron Peacetree wrote: > That Btree can be used to generate a physical reordering of the data > in one pass, but that's the weakest use for it. The more powerful > uses involve allowing the Btree to persist and using it for more > efficient re-searches or combining it with other such Btrees (either as > a step in task distribution across multiple CPUs or as a more efficient > way to do things like joins by manipulating these Btrees rather than > the actual records.) Maybe you could describe some concrete use cases. I can see what you are getting at, and I can imagine some advantageous uses, but I'd like to know what you are thinking. Specifically I'd like to see some cases where this would beat sequential scan. I'm thinking that in your example of a terabyte table with a column having only two values, all the queries I can think of would be better served with a sequential scan. Perhaps I believe this because you can now buy as much sequential I/O as you want. Random I/O is the only real savings. -jwb