Re: Limit for number of Joins in a View? Version 8.1.4 on Redhat 9 - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Limit for number of Joins in a View? Version 8.1.4 on Redhat 9
Date
Msg-id 20070208215820.GO24069@alvh.no-ip.org
Whole thread Raw
In response to Re: Limit for number of Joins in a View? Version 8.1.4 on Redhat 9  (MargaretGillon@chromalloy.com)
Responses Re: Limit for number of Joins in a View? Version 8.1.4 on Redhat 9
List pgsql-general
MargaretGillon@chromalloy.com wrote:
> >Jim Nasby <decibel@decibel.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.

pgsql-general by date:

Previous
From: Andrew Edson
Date:
Subject: Re: Problems shutting down Postmaster
Next
From: MargaretGillon@chromalloy.com
Date:
Subject: Re: Limit for number of Joins in a View? Version 8.1.4 on Redhat 9