X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 047B1D1B8BD for ; Tue, 27 Apr 2004 08:55:37 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 41113-09 for ; Tue, 27 Apr 2004 08:55:37 -0300 (ADT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 7F492D1B554 for ; Tue, 27 Apr 2004 08:55:33 -0300 (ADT) Received: (qmail 12966 invoked from network); 27 Apr 2004 11:55:32 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 27 Apr 2004 11:55:32 -0000 Subject: Re: [JDBC] [PERFORM] is a good practice to create an index on the From: Dave Cramer Reply-To: pg@fastcrypt.com To: Christopher Kings-Lynne Cc: Edoardo Ceccarelli , "pgsql-jdbc@postgresql.org" , pgsql-performance@postgresql.org, pgsql-admin@postgresql.org In-Reply-To: <408DC9E1.8020704@familyhealth.com.au> References: <408D3AE8.5020006@axa.it> <408DC9E1.8020704@familyhealth.com.au> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1083067187.14759.178.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Tue, 27 Apr 2004 07:59:47 -0400 Content-Transfer-Encoding: 7bit X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200404/317 X-Sequence-Number: 13290 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