Re: Index usage

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Index usage
Дата
Msg-id Pine.LNX.4.30.0106091819420.778-100000@peter.localdomain
обсуждение исходный текст
Ответ на Index usage  (Subra Radhakrishnan <subra100@yahoo.com>)
Список pgsql-sql
Subra Radhakrishnan writes:

> Now, I create an index on the employee table using
> 'dept_num' as the attribute. And when I run select
> which looks like:
>
> Explain Select * from employee where dept_num =
> 'Finance';
>
> It does not use the index and tells me that a
> Sequential scan will be done on the table employee.
>
> How do I fix this?

Unless you can prove that an index scan is going to be faster than a
sequential scan, you don't.  Just because there's an index doesn't mean
it's always the best choice to use it.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Inconsistent usage of Index
Следующее
От: "Joe Conway"
Дата:
Сообщение: Re: Inconsistent usage of Index