Received: from linux.scd.net ([209.150.198.180]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2M0QFt26038 for ; Wed, 21 Mar 2001 19:26:15 -0500 (EST) (envelope-from borg@errorcode.com) Received: from home ([209.150.198.179]) by linux.scd.net (8.9.3/8.9.3) with ESMTP id QAA23816 for ; Wed, 21 Mar 2001 16:18:09 -0700 From: "Peter J. Schoenster" Organization: Schoenster To: Date: Wed, 21 Mar 2001 18:10:31 -0700 Subject: Re: CHAR or VARCHAR Reply-to: borg@errorcode.com Message-ID: <3AB8EE97.16683.AF4807A@localhost> In-reply-to: <01032118581204.05822@math.unl.edu.ar> X-mailer: Pegasus Mail for Win32 (v3.12c) X-Archive-Number: 200103/428 X-Sequence-Number: 2096 On 21 Mar 2001, at 18:58, Martin A. Marques wrote: > two questions. > When should I use one, and when the other? > Which is the limit on CHAR(n) and VARCHAR(n)? Okay, here is my more "let's get this thing working" as opposed to "after dedicated study of the matter" opinion (which I hope some dedicated studier might correct or confirm or extend) (and, ps, I do 99% of dev on mysql): I live under the assumption that indexes on CHAR will be "faster" but that CHAR may vary well consume more disk space as I believe it pads data to fit the size you created for it. This page does not help much: http://www.postgresql.org/docs/user/datatype1066.htm This page is interesting: http://www.postgresql.org/docs/user/sql-createindex.htm > Tip: Indexes are primarily used to enhance database performance. But > inappropriate use will result in slower performance. I rarely index a table if there are many inserts/updates. So char vs. varchar .... Peter --------------------------- "Reality is that which, when you stop believing in it, doesn't go away". -- Philip K. Dick