Re: Use of OIDS as primary keys - Mailing list pgsql-general

From Bill Moran
Subject Re: Use of OIDS as primary keys
Date
Msg-id 3CE114BF.5080708@potentialtech.com
Whole thread Raw
In response to Use of OIDS as primary keys  (Alan Wayne <alanjwayne@yahoo.com>)
Responses Re: Use of OIDS as primary keys
List pgsql-general
Tom Lane wrote:
> Martijn van Oosterhout <kleptog@svana.org> writes:
>
>>Do they actually save spaces (consider alignment issues and such)?
>
> WITHOUT OIDS doesn't currently save any space --- the tuple header
> layout is the same either way.  It should save a few microseconds
> per row inserted (since you don't have to generate an OID) but
> that's about it.
>
> The main reason for inventing the feature was to postpone OID-counter
> wraparound in large installations.  Wraparound isn't fatal, but can
> be annoying --- for example, pg_dump may get confused about the best
> order to dump tables in.

Thanks Tom.
So the upshot is that using WITHOUT OIDS on tables with primary keys
doesn't hurt a thing.  But it's a good idea to keep OIDS on tables
without primary keys, since it can improve the operation of certain
internal actions.  There are no space consideration because the OID
is part of a (currently) fixed data structure.

Do I understand correctly?

Thanks.

--
Bill Moran
Potential Technology
http://www.potentialtech.com


pgsql-general by date:

Previous
From: "Robert Abbate"
Date:
Subject: Re: transitioning postgres oid
Next
From: "Joel Burton"
Date:
Subject: Re: restoring databases with intensive foreign key use fails