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: 26766
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: 68719
Registered: March 2007
Location: Saint-Maur, France, https...
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 08 18:22:01 CST 2024