pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomasz Myrta <jasiek@klaster.net>
To: Rafal Kedziorski <rafcio@polonium.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: which type for primary key?
Date: Tue, 11 Feb 2003 11:55:16 +0100
Message-ID: <3E48D694.4050702@klaster.net> (raw)
References: <3E48BF5F.1060403@polonium.de>

Rafal Kedziorski wrote:
> Hi,
> 
> I'm working on J2EE project with PostgreSQL (7.3.2). I know, that a 
> number type is better for primary key as string. I want create primary 
> keys as NUMBER(20). Is this a good idea? what will be a performance for 
> this length?

Postgresql documentation 5.1.2:
"However, the numeric type is very slow compared to the floating-point types described in the next section"
I'm not sure, but number(20) is 10 or 20 bytes length (you need to check this),
which is rather long variable for primary key.

I use always int4 or int8 for primary keys when possible.

Regards,
Tomasz Myrta




view thread (2+ messages)

Message-ID: <3E48D694.4050702@klaster.net>
Permalink:  ../3E48D694.4050702@klaster.net/
Also on:    postgresql.org/message-id/3E48D694.4050702@klaster.net

 · 

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: jasiek@klaster.net, rafcio@polonium.de
  Subject: Re: which type for primary key?
  In-Reply-To: <3E48D694.4050702@klaster.net>

* 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