pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christopher Kings-Lynne <chriskl@familyhealth.com.au>
To: Edoardo Ceccarelli <eddy@axa.it>
Cc: pgsql-jdbc@postgresql.org
Cc: pgsql-performance@postgresql.org
Cc: pgsql-admin@postgresql.org
Subject: Re: [PERFORM] is a good practice to create an index on the oid?
Date: Tue, 27 Apr 2004 10:48:01 +0800
Message-ID: <408DC9E1.8020704@familyhealth.com.au> (raw)
In-Reply-To: <408D3AE8.5020006@axa.it>
References: <408D3AE8.5020006@axa.it>

> I am using the oid of the table as the main key and I've found that is 
> not indexed (maybe because I have declared another primary key in the 
> table)
> 
> it is a good practice to create an index like this on the oid of a table?
> CREATE INDEX idoid annuncio400 USING btree (oid);

Yes it is - in fact you really should add a unique index, not just a 
normal index, as you want to enforce uniqueness of the oid column.  It 
is theoretically possible to end up with duplicate oids in wraparound 
situations.

Even better though is to not use oids at all, of course...

Chris




view thread (11+ messages)  latest in thread

Message-ID: <408DC9E1.8020704@familyhealth.com.au>
Permalink:  ../408DC9E1.8020704@familyhealth.com.au/
Also on:    postgresql.org/message-id/408DC9E1.8020704@familyhealth.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: chriskl@familyhealth.com.au, eddy@axa.it, pgsql-jdbc@postgresql.org, pgsql-performance@postgresql.org
  Subject: Re: [PERFORM] is a good practice to create an index on the oid?
  In-Reply-To: <408DC9E1.8020704@familyhealth.com.au>
  References: <408D3AE8.5020006@axa.it> <408DC9E1.8020704@familyhealth.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox