Re: OID Perfomance - Object-Relational databases

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Field <kev(at)brantaero(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: OID Perfomance - Object-Relational databases
Date: 2006-11-27 17:28:36
Message-ID: C1906E54.5C227%scott_ribe@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> There are basically two ways to attack the problem of a database-wide
> unique ID:
>
> * Use a single int8 sequence for the whole database;
>
> * Use the combination of table OID and row OID (or, perhaps, an int8
> sequence for the row identifier, if you need more than a billion or
> so rows in the table).

There's a third way: int8 serial, lower 48 bits for row id, upper 16 bits
appended with your own table id.

--
Scott Ribe
scott_ribe(at)killerbytes(dot)com
http://www.killerbytes.com/
(303) 722-0567 voice

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Volkan YAZICI 2006-11-27 17:28:57 Re: Returning multiple rows from a function?
Previous Message Scott Ribe 2006-11-27 17:26:01 Re: IS it a good practice to use SERIAL as Primary Key?