From: Peter J. Schoenster <borg@errorcode.com>
To: pgsql-sql@postgresql.org
Subject: Re: CHAR or VARCHAR
Date: Wed, 21 Mar 2001 18:10:31 -0700
Message-ID: <3AB8EE97.16683.AF4807A@localhost> (raw)
In-Reply-To: <01032118581204.05822@math.unl.edu.ar>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: borg@errorcode.com
Subject: Re: CHAR or VARCHAR
In-Reply-To: <3AB8EE97.16683.AF4807A@localhost>
References: <01032118581204.05822@math.unl.edu.ar> <3AB8EE97.16683.AF4807A@localhost>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox