Varchar pkey instead of integer - Mailing list pgsql-performance

From Robins Tharakan
Subject Varchar pkey instead of integer
Date
Msg-id 36af4bed0805202240v5fbdd6bcv75643a6488cd1daf@mail.gmail.com
Whole thread Raw
Responses Re: Varchar pkey instead of integer  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Varchar pkey instead of integer  (Craig Ringer <craig@postnewspapers.com.au>)
List pgsql-performance
Hi,

I am currently designing a database and wanted to know something that may sound trivial, but I thought its still good to confirm before dumping millions of rows in it.

The design requires a few master tables with very limited rows, for e.g. currency_denomination table could at the max have a few records like million / billion / crore (used in india) / lacs (india specific) and so on.

Now what I wanted to ask was whether its any different to have the primary-keys in such master tables as text/varchar rather than integer ? i.e. Can I use a character varying(10) and use the text 'million' / 'billion' instead of a serial / integer type ?

p.s.: I am not as much concerned with the size that it'd take on the data tables, as much as the fact that the select / insert performances shouldn't suffer. However, if that increase in size (per data record) may make a considerable impact on the performance, I would certainly want to take that into account during design phase.

Any pointers / replies appreciated.

Regards,
Robins Tharakan

pgsql-performance by date:

Previous
From: PFC
Date:
Subject: Re: improving performance for a delete
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Varchar pkey instead of integer