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

Re: redundent index?

From: Manfred Koizar <mkoi-pg(at)aon(dot)at>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: Robert Treat <xzilla(at)users(dot)sourceforge(dot)net>,Postgresql Performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: redundent index?
Date: 2003-10-31 13:47:14
Message-ID: jfp4qv01eck5mjgs1cp6fcod392f2r63jq@email.aon.at (view raw or flat)
Thread:
Lists: pgsql-performance
On Wed, 29 Oct 2003 10:17:24 -0500, Rod Taylor <rbt(at)rbt(dot)ca> wrote:
>On Wed, 2003-10-29 at 09:03, Robert Treat wrote:
>> 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

Yes, the actual cost may be a little higher.  But the cost estimation
might be significantly higher, so there can be border cases where the
planner chooses a sequential scan over a multi-column index scan while
a single-column index would correctly be recognized as being faster
...

Servus
 Manfred

In response to

pgsql-performance by date

Next:From: alexandre :: aldeia digitalDate: 2003-10-31 14:03:59
Subject: Re: Pg+Linux swap use
Previous:From: Shridhar DaithankarDate: 2003-10-31 12:52:07
Subject: Re: Pg+Linux swap use

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