Varchar pkey instead of integer

Поиск
Список
Период
Сортировка
От Robins Tharakan
Тема Varchar pkey instead of integer
Дата
Msg-id 36af4bed0805202240v5fbdd6bcv75643a6488cd1daf@mail.gmail.com
обсуждение исходный текст
Ответы Re: Varchar pkey instead of integer  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Varchar pkey instead of integer  (Craig Ringer <craig@postnewspapers.com.au>)
Список 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 по дате отправления:

Предыдущее
От: PFC
Дата:
Сообщение: Re: improving performance for a delete
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Varchar pkey instead of integer