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

Re: [JDBC] [PERFORM] is a good practice to create an index on the

From: Dave Cramer <pg(at)fastcrypt(dot)com>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Edoardo Ceccarelli <eddy(at)axa(dot)it>,"pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>,pgsql-performance(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org
Subject: Re: [JDBC] [PERFORM] is a good practice to create an index on the
Date: 2004-04-27 11:59:47
Message-ID: 1083067187.14759.178.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-adminpgsql-jdbcpgsql-performance
AFAIK, oids aren't used for anything internally, so duplicates don't
really matter. Besides, what would you do about duplicate oid's ?

The best suggestion is of course his last, don't use them.


On Mon, 2004-04-26 at 22:48, Christopher Kings-Lynne wrote:
> > 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
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
> 
>                http://www.postgresql.org/docs/faqs/FAQ.html
> 
> 
> 
> !DSPAM:408dcc51235334924183622!
> 
> 
-- 
Dave Cramer
519 939 0336
ICQ # 14675561


In response to

Responses

pgsql-performance by date

Next:From: Manfred KoizarDate: 2004-04-27 12:12:20
Subject: Re: Shared buffers, Sort memory, Effective Cache Size
Previous:From: Christopher Kings-LynneDate: 2004-04-27 02:48:01
Subject: Re: [PERFORM] is a good practice to create an index on the oid?

pgsql-admin by date

Next:From: Glenn MacGregorDate: 2004-04-27 12:50:49
Subject: Re: delete cascade question
Previous:From: kandiah ratnavaleDate: 2004-04-27 06:17:28
Subject: installation of postgresql-7.2.3-2PGDG

pgsql-jdbc by date

Next:From: Christopher Kings-LynneDate: 2004-04-27 15:01:22
Subject: Re: [JDBC] [PERFORM] is a good practice to create an index on the
Previous:From: Christopher Kings-LynneDate: 2004-04-27 02:48:01
Subject: Re: [PERFORM] is a good practice to create an index on the oid?

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