Re: Faster data type for one-length values - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: Faster data type for one-length values
Date
Msg-id 20070523152226.GQ4642@alvh.no-ip.org
Whole thread Raw
In response to Re: Faster data type for one-length values  (André Volpato<andre.volpato@ecomtecnologia.com.br>)
Responses Re: Faster data type for one-length values
List pgsql-general
André Volpato wrote:

> The ammount of space saved seems pretty clear to me.

Yeah, zero most of the time due to alignment.

> What are you saying is that the index behaviour is the same, for all
> types smaller than 4 bytes ?  For query performance, in a search is
> based on that standalone indexed field, would be any difference using :
>
> a. char(1) ;  b. int2;  c. "char"

char(1) takes at least five bytes (more if the char is multibyte), so it
would be slower than the other two, ceteris paribus.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-general by date:

Previous
From: Rick Schumeyer
Date:
Subject: Tsearch2: upgrading from postgres 8.1.x to 8.2.x
Next
From: Richard Huxton
Date:
Subject: Re: OIDs - file objects, are damaged by PostgreSQL.