Index [message #328860] |
Mon, 23 June 2008 02:16 |
subbu_tce
Messages: 98 Registered: July 2007 Location: pune
|
Member |
|
|
Dear All,
Am having emp table and dept table which contains emp_id as common column name and both of the tables contains btree index on emp_id but the below query goes for full table scan.Can you please explain why and how to write a query that will use index.
Kindly suggets me.
SELECT * FROM EMP_MAST a , EMP_DEPT b WHERE a.emp_code=b.emp_code
|
|
|
|
Re: Index [message #328872 is a reply to message #328860] |
Mon, 23 June 2008 03:29 |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
The main reason that it will go for a full table scan is that there are no conditions in your where clause that restrict the rows retrieved from each table.
|
|
|