pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Shaun Thomas <sthomas@townnews.com>
To: Postgresql Admin <pgsql-admin@postgresql.org>
Subject: Re: Performance impact of record sizes
Date: Fri, 5 Jul 2002 10:00:23 -0500 (CDT)
Message-ID: <Pine.LNX.4.44.0207050856470.17612-100000@hamster.lee.net> (raw)
In-Reply-To: <6353.1025826585@sss.pgh.pa.us>

On Thu, 4 Jul 2002, Tom Lane wrote:

> I can think of very very few applications where CHAR(n) is really a 
> sensible choice over VARCHAR(n).

text hashes such as MD5 and crypt, stock or serial numbers, automotive 
VIN codes, invoice sequences, emulated bitmasks, etc.  Lots of 
industry-specific things are non-varying sequences of characters.

Besides, you don't know true horror until you've seen an amateur set up 
an entire database using nothing but text columns in all the tables.  
Sometimes these types convey meaning about the data they contain, too. 
^_^

> US state postal codes (CHAR(2)) are an example, but beyond that the
> valid use cases are mighty thin on the ground.

Don't forget zipcodes.  You can get away with a char(9), or a char(5) 
and an optional char(4) for the postal extension.  ^_^

-- 
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
| Shaun M. Thomas                INN Database Administrator           |
| Phone: (309) 743-0812          Fax  : (309) 743-0830                |
| Email: sthomas@townnews.com    AIM  : trifthen                      |
| Web  : www.townnews.com                                             |
|                                                                     |
|     "Most of our lives are about proving something, either to       |
|      ourselves or to someone else."                                 |
|                                           -- Anonymous              |
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+







view thread (13+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0207050856470.17612-100000@hamster.lee.net>
Permalink:  ../Pine.LNX.4.44.0207050856470.17612-100000@hamster.lee.net/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0207050856470.17612-100000@hamster.lee.net

 · 

reply

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-admin@postgresql.org
  Cc: sthomas@townnews.com
  Subject: Re: Performance impact of record sizes
  In-Reply-To: <Pine.LNX.4.44.0207050856470.17612-100000@hamster.lee.net>
  References: <6353.1025826585@sss.pgh.pa.us> <Pine.LNX.4.44.0207050856470.17612-100000@hamster.lee.net>

* 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