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