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

Поиск
Список
Период
Сортировка
От Paul Tomblin
Тема Re: Ok, why isn't it using *this* index?
Дата
Msg-id 20010401161029.B26334@allhats.xcski.com
обсуждение исходный текст
Ответ на Re: Ok, why isn't it using *this* index?  ("ADBAAMD" <adba.amdocs@bell.ca>)
Список pgsql-general
Quoting ADBAAMD (adba.amdocs@bell.ca):
> 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';
>
>     Maybe it's just my Oracle side, but doesn't country has a too low
> selectivity?

If I try
    explain select * from waypoint where country = 'BELIZE';
a query that will only select one record out of the 8300-odd, it still
doesn't use the index.
    Seq Scan on waypoint  (cost=455.13 rows=6813 width=130)


--
Paul Tomblin <ptomblin@xcski.com>, not speaking for anybody
Mommy, what does "Formatting Drive C:" mean?

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Ok, why isn't it using *this* index?
Следующее
От: Sean Harding
Дата:
Сообщение: Re: another index question