Proposal: OID wraparound: summary and proposal - Mailing list pgsql-hackers

From Zeugswetter Andreas SB
Subject Proposal: OID wraparound: summary and proposal
Date
Msg-id 11C1E6749A55D411A9670001FA6879633683C1@sdexcsrv1.f000.d0188.sd.spardat.at
Whole thread Raw
List pgsql-hackers
> > At the same time that we announce support for optional OIDs,
> > we should announce that, in future releases, OIDs will only be 
> > guaranteed unique (modulo wraparounds) within a single table.

... if an appropriate unique constraint is explicitly created.

> 
> Seems reasonable --- that will give people notice that we're thinking
> about separate-OID-generator-per-table ideas.

Imho we should think about adding other parts to the external representation
of OID before we start thinking about moving from 4 to 8 bytes in the heap.
Essentially the oid would then be a concatenated e.g. 16 byte number,
that is constructed with:
oid128 = installation oid<<96 + class oid<<64 + for_future_use<<32 + tuple oid

Imho walking that direction would serve the "OID" idea a lot better,
and could actually guarantee a globally unique oid, if the "installation
oid" was centrally managed.

It has the additional advantage of knowing the class by only looking at the oid.

The btree code could be specially tuned to only consider the lower 4(or 8) bytes
on insert and make an early exit for select where oid = wrong class id.

Andreas


pgsql-hackers by date:

Previous
From: Turbo Fredriksson
Date:
Subject: PL/pgSQL: Return multiple rows
Next
From: "Colin 't Hart"
Date:
Subject: Oracle documentation