Re: Choosing primary key type: 64 or 52 bit primary keys?

From: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Choosing primary key type: 64 or 52 bit primary keys?
Date: 2011-07-22 10:25:21
Message-ID: 201107221325.21770.achill@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

bigint by all means. floating point arithmetic is somewhat more bloated/fuzzy/straight forward than integer,
and even if postgresql was perfect regarding floating point comparisons, no one can claim
the same for client languages. So define your PK as bigint.

Στις Friday 22 July 2011 10:01:58 ο/η Antonio Vieiro έγραψε:
> Hi all,
>
> I'd like to use an integer number for my primary key. I need it to be
> bigger than 32 bits.
>
> As far as I understand I have two options:
>
> a) use all the 64 bits of a 'bigint'
> b) use the 52 mantissa bits of a 'double precision'
>
> My question is, which would be faster for indexing? I assume the
> bigint wins here, right?
>
> Thanks in advance,
> Antonio
>

--
Achilleas Mantzios

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Willy-Bas Loos 2011-07-22 10:52:09 Re: COPY TO '|gzip > /my/cool/file.gz'
Previous Message Tomas Vondra 2011-07-22 09:58:53 Re: Maximum number of client connection supported by Postgres 8.4.6