[PERFORM] redundent index?

2003-10-29 Thread Robert Treat
I just noticed on one of my tables I have the following two indexes:

Indexes: entity_watch_map_pkey primary key btree (entity_id, watch_id),
 ewm_entity_id btree (entity_id),


I can't think of why the second index is there, as ISTM there is no
instance where the first index wouldn't be used in place of the second
one if i were to delete the second one. its a heavily updated table, so
axing the second one would be a bonus for performance, am i missing
something? Thanks in advance, 


Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PERFORM] redundent index?

2003-10-29 Thread Rod Taylor
On Wed, 2003-10-29 at 09:03, Robert Treat wrote:
 I just noticed on one of my tables I have the following two indexes:
 
 Indexes: entity_watch_map_pkey primary key btree (entity_id, watch_id),
  ewm_entity_id btree (entity_id),
 
 
 I can't think of why the second index is there, as ISTM there is no
 instance where the first index wouldn't be used in place of the second

The cost in evaluating the first index will be a little higher (more
data to pull off disk due to second item), so there may be a few
borderline cases that could switch to a sequential scan rather than an
index scan.


signature.asc
Description: This is a digitally signed message part