pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Raj Mathur (राज माथुर) <raju@linux-delhi.org>
To: pgsql-sql@postgresql.org
Subject: Generic design: char vs varchar primary keys
Date: Wed, 3 Aug 2011 20:40:17 +0530
Message-ID: <201108032040.17628.raju@linux-delhi.org> (raw)

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@kandalaya.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



view thread (5+ messages)  latest in thread

Message-ID: <201108032040.17628.raju@linux-delhi.org>
Permalink:  ../201108032040.17628.raju@linux-delhi.org/
Also on:    postgresql.org/message-id/201108032040.17628.raju@linux-delhi.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: raju@linux-delhi.org
  Subject: Re: Generic design: char vs varchar primary keys
  In-Reply-To: <201108032040.17628.raju@linux-delhi.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox