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 C5263D1B478 for ; Mon, 26 Apr 2004 20:00:06 -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 02804-07 for ; Mon, 26 Apr 2004 20:00:05 -0300 (ADT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 2FE40D1B46C for ; Mon, 26 Apr 2004 20:00:02 -0300 (ADT) Received: (qmail 10274 invoked from network); 26 Apr 2004 23:00:00 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 26 Apr 2004 23:00:00 -0000 Subject: Re: [JDBC] is a good practice to create an index on the oid? From: Dave Cramer Reply-To: pg@fastcrypt.com To: Edoardo Ceccarelli Cc: "pgsql-jdbc@postgresql.org" , pgsql-performance@postgresql.org, pgsql-admin@postgresql.org In-Reply-To: <408D3AE8.5020006@axa.it> References: <408D3AE8.5020006@axa.it> Content-Type: text/plain Organization: Cramer Consulting Message-Id: <1083020647.13952.164.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Mon, 26 Apr 2004 19:04:07 -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=3.0 tagged_above=0.0 required=5.0 tests=SUSPICIOUS_RECIPS X-Spam-Level: *** X-Archive-Number: 200404/314 X-Sequence-Number: 13287 Yes, you can create an index on the oid, but unless you are selecting on it, it is of little use. you would have to do select * from foo where oid=? to get any value out of the index. Dave On Mon, 2004-04-26 at 12:38, Edoardo Ceccarelli 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); > > > does it work as a normal index? > > Thank you > Edoardo > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly > > > > !DSPAM:408d7c38183971270217895! > > -- Dave Cramer 519 939 0336 ICQ # 14675561