pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
which type for primary key?
2+ messages / 2 participants
[nested] [flat]

* which type for primary key?
@ 2003-02-11 09:16 Rafal Kedziorski <rafcio@polonium.de>
  2003-02-11 10:55 ` Re: which type for primary key? Tomasz Myrta <jasiek@klaster.net>
  0 siblings, 1 reply; 2+ messages in thread

From: Rafal Kedziorski @ 2003-02-11 09:16 UTC (permalink / raw)
  To: pgsql-sql

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?


Best Regards,
Rafal




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: which type for primary key?
  2003-02-11 09:16 which type for primary key? Rafal Kedziorski <rafcio@polonium.de>
@ 2003-02-11 10:55 ` Tomasz Myrta <jasiek@klaster.net>
  0 siblings, 0 replies; 2+ messages in thread

From: Tomasz Myrta @ 2003-02-11 10:55 UTC (permalink / raw)
  To: Rafal Kedziorski <rafcio@polonium.de>; +Cc: pgsql-sql

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




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-02-11 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-02-11 09:16 which type for primary key? Rafal Kedziorski <rafcio@polonium.de>
2003-02-11 10:55 ` Tomasz Myrta <jasiek@klaster.net>

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