Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 5E86E2E002C for ; Wed, 21 May 2008 02:52:16 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 29619-05 for ; Wed, 21 May 2008 02:52:04 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.187]) by developer.postgresql.org (Postfix) with ESMTP id 6394A2E0064 for ; Wed, 21 May 2008 02:47:36 -0300 (ADT) Received: by ti-out-0910.google.com with SMTP id y8so1583144tia.5 for ; Tue, 20 May 2008 22:47:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=KdYXnv/gKJuiB+/M2xe52aAuskn7JCg/IH4FgiTedqE=; b=apo30Obq11AuJSVd9yGYuzQfOX6wqQt2txuxKFXAuAGq/AlzJBbm/2ocjfQ3BTf5ZMjsofATR0tnnZIEVxpAlNd6ptJjY1WdJrFXp5zSd5yJXDJCbAfphaMACJ/hArbA+p7C96oZGNtBlJFc+RrnngVMjr/Y2pfMB9P1K/LQ4mY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=pcCP/jgnodUKY1KGAGOwq3+zA6vddLQK4L3L72Fq3DwkitqVbLxdYp2aAraJJaEQO8ucOhQ3ohSBIBMI5BK2m+PL6hIr6ijWDvjV6VFQ8p5bYCHuW1HZsIeU9zGy1zBPkPs2+OWesi3BmHE6NcmXPo93BU3BA14j5GwAjaOysZM= Received: by 10.110.69.5 with SMTP id r5mr1205862tia.17.1211348443434; Tue, 20 May 2008 22:40:43 -0700 (PDT) Received: by 10.110.57.17 with HTTP; Tue, 20 May 2008 22:40:43 -0700 (PDT) Message-ID: <36af4bed0805202240v5fbdd6bcv75643a6488cd1daf@mail.gmail.com> Date: Wed, 21 May 2008 11:10:43 +0530 From: "Robins Tharakan" To: pgsql-performance@postgresql.org Subject: Varchar pkey instead of integer MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_14845_16568334.1211348443432" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200805/279 X-Sequence-Number: 30247 ------=_Part_14845_16568334.1211348443432 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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* ------=_Part_14845_16568334.1211348443432 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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
------=_Part_14845_16568334.1211348443432--