X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 831CB528A7 for ; Fri, 27 May 2005 18:28:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 18940-10 for ; Fri, 27 May 2005 21:27:58 +0000 (GMT) Received: from sccrmhc11.comcast.net (sccrmhc11.comcast.net [204.127.202.55]) by svr1.postgresql.org (Postfix) with ESMTP id 30F96528A5 for ; Fri, 27 May 2005 18:27:57 -0300 (ADT) Received: from [192.168.1.52] (c-24-60-119-214.hsd1.ma.comcast.net[24.60.119.214]) by comcast.net (sccrmhc11) with ESMTP id <2005052721275801100mk0ome>; Fri, 27 May 2005 21:27:58 +0000 Message-ID: <429790E1.5040308@comcast.net> Date: Fri, 27 May 2005 17:28:01 -0400 From: Jeffrey Tenny User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: Redundant indexes? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.274 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST X-Spam-Level: * X-Archive-Number: 200505/415 X-Sequence-Number: 12579 Would I be correct in assuming that the following two indexes are completely redundant except for the fact that one complains about uniqueness constraint violations and the other does not? Or is there are legitimate use for having BOTH indexes? I'm trying to figure out if it's okay to delete the non-unique index. (I have a bunch of tables suffering this malady from some problematic application code). Table "public.erf" Column | Type | Modifiers --------+---------+----------- rid | integer | not null cid | integer | not null Indexes: erf_rid_key unique btree (rid), erf_rid_idx btree (rid) Index "public.erf_rid_idx" Column | Type --------+--------- rid | integer btree, for table "public.erf" Index "public.erf_rid_key" Column | Type --------+--------- rid | integer unique, btree, for table "public.erf"