pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Subra Radhakrishnan <subra100@yahoo.com>
To: pgsql-sql@postgresql.org
Subject: Index usage
Date: Fri, 8 Jun 2001 20:27:25 -0700 (PDT)
Message-ID: <20010609032725.53194.qmail@web13804.mail.yahoo.com> (raw)

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/



view thread (3+ messages)  latest in thread

Message-ID: <20010609032725.53194.qmail@web13804.mail.yahoo.com>
Permalink:  ../20010609032725.53194.qmail@web13804.mail.yahoo.com/
Also on:    postgresql.org/message-id/20010609032725.53194.qmail@web13804.mail.yahoo.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: subra100@yahoo.com
  Subject: Re: Index usage
  In-Reply-To: <20010609032725.53194.qmail@web13804.mail.yahoo.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox