Re: Ok, why isn't it using *this* index?

From: "ADBAAMD" <adba(dot)amdocs(at)bell(dot)ca>
To: "Paul Tomblin" <ptomblin(at)xcski(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Ok, why isn't it using *this* index?
Date: 2001-04-01 19:51:13
Message-ID: 3AC786B1.5030108@bell.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Paul Tomblin wrote:

> I have a table with columns 'country' and 'state'. I put indexes on both
> of them. I've done the "vacuum analyze" as per the faq. But when I ask
> it to explain, it says it will use the index on 'state' if I do a
> select * from waypoint where state = 'ON';
> but it won't use the index on 'country' if I do a
> select * from waypoint where country = 'CANADA';
>
> Some other interesting things are that it uses the index on state even if
> I say "where state in ('ON','QC','BC','AB')", and it uses the index on
> state but not the one on country if I combine "where state = 'ON' and
> country = 'CANADA'".

Maybe it's just my Oracle side, but doesn't country has a too low
selectivity?

--
_
/ \ Leandro Guimarães Faria Corsetti Dutra +55 (11) 3040 8913
\ / Amdocs at Bell Canada +1 (514) 786 87 47
X Support Center, São Paulo, Brazil mailto:adbaamd(at)bell(dot)ca
/ \ http://terravista.pt./Enseada/1989/ mailto:leandrod(at)amdocs(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message ADBAAMD 2001-04-01 19:52:37 Re: Memory Tuning
Previous Message Tom Lane 2001-04-01 19:47:45 Re: Dissapearing indexes, what's that all about?