From: | Alvaro Herrera <alvherre(at)commandprompt(dot)com> |
---|---|
To: | MargaretGillon(at)chromalloy(dot)com |
Cc: | Jim Nasby <decibel(at)decibel(dot)org>, Richard Huxton <dev(at)archonet(dot)com>, pgsql-general(at)postgresql(dot)org |
Subject: | Re: Limit for number of Joins in a View? Version 8.1.4 on Redhat 9 |
Date: | 2007-02-08 21:58:20 |
Message-ID: | 20070208215820.GO24069@alvh.no-ip.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
MargaretGillon(at)chromalloy(dot)com wrote:
> >Jim Nasby <decibel(at)decibel(dot)org> wrote on 02/08/2007 12:12:00 PM:
> > If you do end up back at using foreign keys, I suggest using either a
> > smallint or "char"... the savings across the number of fields you're
> > looking at would start to add up, especially if you start putting a
> > decent number of rows in the table.
>
> I ended up using Varchar(1). According to the help there is no speed
> difference in the character types, on am I misunderstanding something?
The "char" type (including quotes) is a very different animal from all
those character types the manual you quote is talking about. "char" is
a single byte, while varchar(1) and all the rest are a single character,
meaning there can be multiple bytes in presence of a multibyte encoding;
so Postgres is forced to use a variable-length structure to store it.
"char" has no such requirement. It's used in the system catalogs as a
"poor man's enum", for example in pg_class.relkind.
--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Troy | 2007-02-08 22:00:00 | Re: Problems shutting down Postmaster |
Previous Message | Andrew Edson | 2007-02-08 21:48:39 | Re: Problems shutting down Postmaster |