Search Postgresql Archives

Re: The speed problem of Varchar vs. Char

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux