Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2Q4BGw22822 for ; Sun, 25 Mar 2001 23:11:16 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 29769 for ; Sun, 25 Mar 2001 20:11:08 -0800 From: "Josh Berkus" Subject: Re: CHAR or VARCHAR To: pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Sun, 25 Mar 2001 20:11:08 -0800 Message-ID: In-Reply-To: <19429.985554891@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200103/509 X-Sequence-Number: 2180 Folks - > On other DBMSes there could be a difference, especially if the DBMS > has > performance problems with variable-length fields. For example ... MS-SQL Server 7.0 requires 2 extra bytes to store the length of a string for VARCHAR. Thus, CHAR(3) takes 3 bytes (roughly) and VARCHAR(3) takes 5. Thus, if you knew that 90% of a particular field's entries were going to be the same length, you could save some storage space, and some processing power on scans and joins, by using CHAR instead of VARCHAR. (FYI, SQL Server 7 still has an 8K row limit; I'm not sure about SQL Server 2000). Now, Tom, at what point do character values begin to be stored "outside the table"? This is something I want to avoid, having had some bad experiences with pointers and DB corruption (although not with PGSQL). -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco