Re: CHAR or VARCHAR - Mailing list pgsql-sql

From Peter J. Schoenster
Subject Re: CHAR or VARCHAR
Date
Msg-id 3AB8EE97.16683.AF4807A@localhost
Whole thread Raw
In response to CHAR or VARCHAR  ("Martin A. Marques" <martin@math.unl.edu.ar>)
List pgsql-sql
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


pgsql-sql by date:

Previous
From: "datactrl"
Date:
Subject: Re: Re: psql win32 version
Next
From: Josh Berkus
Date:
Subject: Re: CHAR or VARCHAR