X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 037A1D1CB21 for ; Fri, 5 Mar 2004 23:29:47 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 05129-07 for ; Fri, 5 Mar 2004 19:29:48 -0400 (AST) Received: from davinci.ethosmedia.com (server228.ethosmedia.com [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 344EBD1CAD0 for ; Fri, 5 Mar 2004 19:29:45 -0400 (AST) Received: from [63.195.55.98] (HELO 192.168.1.29) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 4549276; Fri, 05 Mar 2004 15:30:54 -0800 From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Bill Moran , Jeff Subject: Re: Fixed width rows faster? Date: Fri, 5 Mar 2004 15:28:55 -0800 User-Agent: KMail/1.5.4 Cc: pgsql-performance@postgresql.org References: <404889A6.7@potentialtech.com> In-Reply-To: <404889A6.7@potentialtech.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200403051528.55578.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200403/63 X-Sequence-Number: 5919 Jeff, Bill: > No. The user docs state that the performance is equal for char, varchar > and text. Actually, CHAR is slightly *slower* than VARCHAR or TEXT for SELECTs in many applications. This is becuase of the field padding, and the frequent necessity of casting CHAR::TEXT and back. For INSERT and UPDATE, TEXT is the fastest becuase it's not checking a length constraint (takes time) or padding the field out to the required CHAR length (even more time). Frankly, the only reason to use anything other than TEXT is compatibility with other databases and applications. -- -Josh Berkus Aglio Database Solutions San Francisco