Index usage

Поиск
Список
Период
Сортировка
От Subra Radhakrishnan
Тема Index usage
Дата
Msg-id 20010609032725.53194.qmail@web13804.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Index usage  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: Index usage  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-sql
Hi All,

The index created by me is not being used while doing
select. I found that out by using the EXPLAIN. For
example:

Table department has 
----------------
dept_num
dept_desc


Table 'employee' looks like this:
--------------------------------
emp_num primary key,
emp_name,
dept_num (this is by way of foreign key relation from
department table)

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? 

Thanx in advance,

Subra

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/


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

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: maximum number of rows in table - what about oid limits?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Index usage