Faster data type for one-length values

From: André Volpato <andre(dot)volpato(at)ecomtecnologia(dot)com(dot)br>
To: pgsql-general(at)postgresql(dot)org
Subject: Faster data type for one-length values
Date: 2007-05-23 13:49:21
Message-ID: 46544661.4020002@ecomtecnologia.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I need to store one-length values like '1', '2', '3' or '4' .

Today, this field is indexed with btree and is of type smallint (int2).
How much performance will be improved if I change it to "char" (1 byte
length) ? Or int2 is the best solution in this case ?

Thanks !

--
[]´s,

André Volpato
ECOM Tecnologia Ltda
andre(dot)volpato(at)ecomtecnologia(dot)com(dot)br

Responses

Browse pgsql-general by date

  From Date Subject
Next Message J. ORIOL 2007-05-23 13:53:43 Re: Several queries consume 100 % processor
Previous Message Richard Huxton 2007-05-23 13:05:05 Re: Several queries consume 100 % processor