Re: The speed problem of Varchar vs. Char - Mailing list pgsql-general

From Tim Tassonis
Subject Re: The speed problem of Varchar vs. Char
Date
Msg-id 469C8FD8.8090200@cubic.ch
Whole thread Raw
In response to Re: The speed problem of Varchar vs. Char  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
>
> Once upon a time, in the days of 80-column punch cards and no
> variable-length character encodings, there were databases that could
> handle fixed-width character fields a bit faster than variable-width.
> That doesn't apply to Postgres.  There is no, none, nada performance
> advantage to char(n), and you should never use it unless your
> application data clearly demands a specific field width.

I still often use char(n) a lot, mainly for documentation purposes. If a
column will only ever hold exactly a fixed length string (status codes
and stuff), it looks better in the datamodel to use char(n) IMHO.

Tim


pgsql-general by date:

Previous
From: Gregory Stark
Date:
Subject: Re: interaction with postgres defined types in custom c functions
Next
From: "Erik Peterson"
Date:
Subject: Update of table lags execution of statement by >1 minute?