Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: O9i: How to create a matching index to a given query
Sorry, it is me again. I do not understand the following:
select
-- B.cbemerkung,
B.cvnk
from
tbbaeume B
where
B.cidnebenanlage <> '0000000000'
Table tbbaeume has 500 000 rows, only 65 of them has another cidnebenanlage than '0000000000'.
There are some indexes, cvnk and cidnebenanlage are part of most of
them, cbemerkung never.
The statement above has the following explain plan:
The query is answered within 1 millisecond.
If I delete -- from the query the explain plan is
In that case it takes 20 seconds.
I thought that an index has only effects on where/join and group by
clauses?
I tested to build an index on TBBAEUME(CVNK, CBEMERKUNG) and as expected
the result was the same as 2nd try. A full table scan with very poor
performance.
Why the execution plan changes if I only change the fieldlist?
Andreas Mosmann
-- wenn email, dann AndreasMosmann <bei> web <punkt> deReceived on Mon Apr 02 2007 - 14:24:45 CDT
![]() |
![]() |