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 F367FD1B47C; Mon, 26 Apr 2004 23:43:07 -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 69259-02; Mon, 26 Apr 2004 23:43:10 -0300 (ADT) Received: from houston.familyhealth.com.au (fhnet.arach.net.au [203.22.197.21]) by svr1.postgresql.org (Postfix) with ESMTP id CDDC7D1B44C; Mon, 26 Apr 2004 23:43:04 -0300 (ADT) Received: from familyhealth.com.au (work-40.internal [192.168.0.40]) by houston.familyhealth.com.au (8.12.9p1/8.12.9) with ESMTP id i3R2gtWL087170; Tue, 27 Apr 2004 10:42:59 +0800 (WST) (envelope-from chriskl@familyhealth.com.au) Message-ID: <408DC9E1.8020704@familyhealth.com.au> Date: Tue, 27 Apr 2004 10:48:01 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla Thunderbird 0.5 (Windows/20040207) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Edoardo Ceccarelli Cc: pgsql-jdbc@postgresql.org, pgsql-performance@postgresql.org, pgsql-admin@postgresql.org Subject: Re: [PERFORM] is a good practice to create an index on the oid? References: <408D3AE8.5020006@axa.it> In-Reply-To: <408D3AE8.5020006@axa.it> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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/315 X-Sequence-Number: 13288 > 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