Skip site navigation (1) Skip section navigation (2)

Re: OIDs as keys

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: daniel alvarez <d-alvarez(at)gmx(dot)de>,pgsql-performance(at)postgresql(dot)org
Subject: Re: OIDs as keys
Date: 2003-02-26 16:02:30
Message-ID: 29927.1046275350@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Richard Huxton <dev(at)archonet(dot)com> writes:
>> How unique are oids as of version 7.3 of postgres ?

> OIDs are unique per object (table) I believe, no more so.

Even then, you should only assume uniqueness if you put a unique index
on the table's OID column to enforce it.  (The system catalogs that use
OID all have such indexes.)  Without that, you might have duplicates
after the OID counter wraps around.

>> Will the oid type be extended so that oids can be larger than 4 bytes (if
>> this is still correct for 7.3) and do not rotate in large systems?

> Strikes me as unlikely, though I'm not a developer.

I tend to agree.  At one point that was a live possibility, but now
we're more likely to change the default for user tables to WITHOUT OIDS
and declare the problem solved.  Making OIDs 8 bytes looks like too much
of a performance hit for non-64-bit machines.  (Not to mention machines
that haven't got "long long" at all; right now the only thing that
doesn't work for them is type int8, and I'd like it to stay that way,
at least for a few more years.)

			regards, tom lane

In response to

pgsql-performance by date

Next:From: Richard HuxtonDate: 2003-02-26 16:10:13
Subject: Re: OIDs as keys
Previous:From: Tom LaneDate: 2003-02-26 15:56:04
Subject: Re: OIDs as keys

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group