Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Murach's Java Servlets and JSP
this week in the
Why my index is not used?
Joined: Sep 20, 2001
Aug 03, 2010 12:07:06
These 2 queries take 23 seconds on Oracle:
(1) select invline from mrcmpower.bisales order by invline desc
(2) select invline from mrcmpower.bisales where invline >0 order by invline desc
They should be the same because all 2 million rows in the table have invline > 0.
Then I added index: create index mrcmpower.index2 on mrcmpower.bisales (invline desc)
Now query (1) still takes
and query (2) only takes
Why query (1) does not use the index?
BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design
Joined: Oct 10, 2000
Aug 03, 2010 12:12:36
It is sorta covered in the
JavaRanch Style Guide
subject: Why my index is not used?
Oracle Text Error when "FUZZY"is used
Help needed on ejb query
Selecting data from more than one table: I am getting exception
Oracle ORA-29902 Error!
"select.." in jdbc gives bad performance but not in mysql directly
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014