![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm trying to speed up my query which selects only 30 records out of 3million records. All my conditions are indexed but when I explains it, it says TABLE ACCESS FULL. I use "between" and, it seemingly, when I reduce range of "between" then it does INDEX RANGE SCAN. Is there anyway I can force to do INDEX RANGE SCAN? Thanks. -Jay post your oracle version and query. Also, what are |
#3
| |||
| |||
|
|
I'm trying to speed up my query which selects only 30 records out of 3million records. All my conditions are indexed but when I explains it, it says TABLE ACCESS FULL. I use "between" and, it seemingly, when I reduce range of "between" then it does INDEX RANGE SCAN. Is there anyway I can force to do INDEX RANGE SCAN? Thanks. -Jay |
#4
| |||
| |||
|
|
Is there anyway I can force to do INDEX RANGE SCAN? |
#5
| |||
| |||
|
|
I'm trying to speed up my query which selects only 30 records out of 3million records. All my conditions are indexed but when I explains it, it says TABLE ACCESS FULL. |
|
I use "between" and, it seemingly, when I reduce range of "between" then it does INDEX RANGE SCAN. |
|
Is there anyway I can force to do INDEX RANGE SCAN? |
#6
| |||||
| |||||
|
|
Case 2. The exact opposite of case 1. Thus the index IS used. |
|
You have proved two things. a) Oracle CBO works as it should (and better than you thought) |
|
b) You could spend some more time with the Oracle manuals :-) |
|
IMO never ever enforce an index range scan (yes it is possible using hints). Index range scans can be a lot more painful than a FTS. When dealing with unknown index ranges, let the database (i.e. CBO) decides. |
|
I'm trying to speed up my query which selects only 30 records out of 3million records. |
#7
| |||
| |||
|
|
I'm trying to speed up my query which selects only 30 records out of 3million records. All my conditions are indexed but when I explains it, it says TABLE ACCESS FULL. I use "between" and, it seemingly, when I reduce range of "between" then it does INDEX RANGE SCAN. Is there anyway I can force to do INDEX RANGE SCAN? Thanks. -Jay |
#8
| ||||
| ||||
|
|
Like he said: he's doing case 2 (30 rows out of 3 million) and the optimizer is NOT picking the index.. |
|
In the chapter about indexes in Expert oneonone, TK goes at length under which conditions using an index is or is not better than doing a FTS. |
|
In anyone's book that is not an unknown index range... I agree though: WHEN dealing with *unknown* ranges, then it's better to let the CBO do its work. If it tends to err on the side of pessimism, it's always possible to nudge it in the right direction with the "optimizer_*" stuff. That is of course the general case. |
|
OT: waddyareckon: Boks, AllBlacks or the Poms? |
#9
| |||
| |||
|
|
"Noons" <wizofoz2k (AT) yahoo (DOT) com.au.nospam> wrote Like he said: he's doing case 2 (30 rows out of 3 million) and the optimizer is NOT picking the index.. Yeah, I did see that "30 rows being returned/selected", but I was thinking group by was neglected to be mentioned. Well either that, or the CBO is seriously screwy when deciding FTS to do only 30 rows. The latter I will only believe when hard evidence is given. :-) |
|
Agree. That is IF the statement on 30 rows being selected ALSO implies that these are also *only* 30 rows (of the millions) being processed. And in the absense of more detail, I cannot see that to be the case when the CBO decides to do a FTS. OT: waddyareckon: Boks, AllBlacks or the Poms? Tough one. Of course I'm hoping for the Boks. The Poms are damn good, but the longer you're on the top, the more difficult it becomes to stay there. I do not think that they can keep up that level of play consistently for such a long time. They have everything to lose and little to gain. Not forgetting the Kiwis either. They have a good team. And then there's the mightly AllBlacks... So the heart says Bokke but the brain says mebbe the AllBlacks. Besides, us southern hemisphere okes have to stand together. :-) |
FWIW I see England winning the competition in a![]() |
| Thread Tools | |
| Display Modes | |
| |