Skip site navigation (1) Skip section navigation (2)

Re: redundent index?

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>
Cc: Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: redundent index?
Date: 2003-10-29 15:17:24
Message-ID: 1067440627.5789.2.camel@jester (view raw or flat)
Thread:
Lists: pgsql-performance
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.

In response to

Responses

pgsql-performance by date

Next:From: mallahDate: 2003-10-29 19:22:43
Subject: PostgreSQL 7.4beta5 vs MySQL 4.0.16 with RT(DBIx::SearchBuilder)
Previous:From: Damien DouganDate: 2003-10-29 14:40:06
Subject: Re: Very Poor Insert Performance

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group