X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A564014B281A for ; Tue, 10 Aug 2004 14:23:48 -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 78011-07 for ; Tue, 10 Aug 2004 17:23:46 +0000 (GMT) Received: from davinci.ethosmedia.com (server226.ethosmedia.com [209.128.84.226]) by svr1.postgresql.org (Postfix) with ESMTP id 0BC6014B2800 for ; Tue, 10 Aug 2004 14:23:44 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 6042583; Tue, 10 Aug 2004 10:24:57 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: Bill Montgomery , pgsql-performance@postgresql.org Subject: Re: Column order performance Date: Tue, 10 Aug 2004 10:23:28 -0700 User-Agent: KMail/1.4.3 References: <4118D008.1070606@lulu.com> In-Reply-To: <4118D008.1070606@lulu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200408101023.28084.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/133 X-Sequence-Number: 7769 Bill, > Does the order of columns of varying size have any effect on > SELECT/INSERT/UPDATE/and/or/DELETE performance? Take the example where > an integer primary key is listed first in the table and alternatively > listed after some large varchar or text columns? No, the "order" of the columns in the table makes no difference. They are not physically stored in the metadata order, anyway; on the data pages, fixed-length fields (e.g. INT, BOOLEAN, etc.) are stored first and variable-length fields (CHAR, TEXT, NUMERIC) after them, AFAIK. The only thing I have seen elusive reports of is that *display* speed can be afffected by column order (e.g. when you call the query to the command line with many rows) but I've not seen this proven in a test case. -- Josh Berkus Aglio Database Solutions San Francisco