Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id EFFF7476CE7 for ; Fri, 1 Nov 2002 15:24:01 -0500 (EST) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id F2CDB476D76 for ; Fri, 1 Nov 2002 15:23:59 -0500 (EST) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 3.5.9) with ESMTP id 1808698; Fri, 01 Nov 2002 12:26:15 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Wei Weng , pgsql-performance@postgresql.org Subject: Re: Does this matter? Date: Fri, 1 Nov 2002 12:23:48 -0800 X-Mailer: KMail [version 1.4] References: <1036181881.24810.1.camel@Monet> In-Reply-To: <1036181881.24810.1.camel@Monet> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211011223.48962.josh@agliodbs.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/11 X-Sequence-Number: 169 Wei, > Does it make a performance difference if I use a char(20) or a char(36) > as the primary key? My thought is no, but I would like to hear more > opinions. Yes, it does, though probably minor unless you have millions of records. C= HAR=20 is padded out to the specified length. Therefore the index on a char(36)= =20 column will be a little larger, and thus a little slower, than the char(20)= .=20=20 Now, there would be no difference between VARCHAR(20) and VARCHAR(36) unles= s=20 you used some of the extra 16 characters on most rows. Either way, for tables of a few thousand records, I doubt that you'll notic= e=20 the difference. BTW, why not use a SERIAL value as a surrogate primary ke= y? > And a little further off topic(since we have many database experts > here), does it matter on MS SQL server 7? Yes, same reason. --=20 -Josh Berkus Aglio Database Solutions San Francisco