pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Redundant indexes?
2+ messages / 2 participants
[nested] [flat]

* Redundant indexes?
@ 2005-05-27 21:28 Jeffrey Tenny <jeffrey.tenny@comcast.net>
  2005-05-28 00:09 ` Re: Redundant indexes? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 2+ messages in thread

From: Jeffrey Tenny @ 2005-05-27 21:28 UTC (permalink / raw)
  To: pgsql-performance

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"





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Redundant indexes?
  2005-05-27 21:28 Redundant indexes? Jeffrey Tenny <jeffrey.tenny@comcast.net>
@ 2005-05-28 00:09 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2005-05-28 00:09 UTC (permalink / raw)
  To: Jeffrey Tenny <jeffrey.tenny@comcast.net>; +Cc: pgsql-performance

Jeffrey Tenny <jeffrey.tenny@comcast.net> writes:
> 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?

Yup ...

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2005-05-28 00:09 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-05-27 21:28 Redundant indexes? Jeffrey Tenny <jeffrey.tenny@comcast.net>
2005-05-28 00:09 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox