Re: Use of OIDS as primary keys

From: Bill Moran <wmoran(at)potentialtech(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: Use of OIDS as primary keys
Date: 2002-05-14 13:44:31
Message-ID: 3CE114BF.5080708@potentialtech.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom Lane wrote:
> Martijn van Oosterhout <kleptog(at)svana(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joel Burton 2002-05-14 13:55:05 Re: restoring databases with intensive foreign key use fails
Previous Message Bill Moran 2002-05-14 13:32:59 Re: Strange interaction with php's pg_query