Home » SQL & PL/SQL » SQL & PL/SQL » Index (Oracle 10g)
Index [message #330836] Tue, 01 July 2008 08:12 Go to next message
subbu_tce
Messages: 98
Registered: July 2007
Location: pune
Member
Dear All,
select * from emp where emp_code >= 1000 .Am having index on emp_code but system is taking full table scan,but if i use emp_code < 1000 index range scan is going.Why ?Kindly suggests.
Re: Index [message #330837 is a reply to message #330836] Tue, 01 July 2008 08:14 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
subbu_tce wrote on Tue, 01 July 2008 06:12
Dear All,
select * from emp where emp_code >= 1000 .Am having index on emp_code but system is taking full table scan,but if i use emp_code < 1000 index range scan is going.Why ?Kindly suggests.

why not?
Sometimes a full table scan is more efficient.
Re: Index [message #330849 is a reply to message #330836] Tue, 01 July 2008 08:30 Go to previous message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Why do you think the answer will be different that the one you posted 2 hours before?

http://www.orafaq.com/forum/m/330802/102589/#msg_330802

Regards
Michel
Previous Topic: sql help
Next Topic: Decode to display result of the columns in one row
Goto Forum:
  


Current Time: Sun Dec 04 18:25:31 CST 2016

Total time taken to generate the page: 0.07623 seconds