Generic design: char vs varchar primary keys

From: "Raj Mathur ( राज =?utf-8?b?IOCkruCkvuCkpeClgeCksA==?=)" <raju(at)linux-delhi(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: Generic design: char vs varchar primary keys
Date: 2011-08-03 15:10:17
Message-ID: 201108032040.17628.raju@linux-delhi.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

Can you point me to any pages that explain the difference between using,
say CHAR(8) vs VARCHAR(8) as the primary key for a table? Is there any
impact on the database in terms of:

- Speed of indexed retrieval
- Speed of join from a referencing table
- Storage (I presume VARHAR(8) would have a slight edge, in general)
- Any other issue

Regards,

-- Raj
--
Raj Mathur raju(at)kandalaya(dot)org http://kandalaya.org/
GPG: 78D4 FC67 367F 40E2 0DD5 0FEF C968 D0EF CC68 D17F
PsyTrance & Chill: http://schizoid.in/ || It is the mind that moves

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Kupershmidt 2011-08-03 22:24:17 Re: Generic design: char vs varchar primary keys
Previous Message Tim Landscheidt 2011-08-03 04:05:26 Re: Help with regexp-query