Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> R: Tunning Select and Where statements
I suppose you have a B-tree index on 'age'. In this case your index is not
enough selective. Sometime a full scan of the table is better than an access
to the index followed by an access by ROWID to the table.
In the second case you have a performance improvement because you avoid the
second access by rowid. The name infact is already in the index segment.
If your table is really large you should try to use an hash index on age to
speed up your query.
Ric
> >SELECT name FROM people WHERE age = 21;
> >
> >Why would an index on 'age' in WHERE clause result in a slower query
than
> >having no index.
> >Why would an index on both 'name' and 'age' result in a faster query.
> >
> >Thanks for any Help
> >
> >
> >Ming.
> >
> >
>
>
Received on Thu Oct 14 1999 - 09:06:56 CDT
![]() |
![]() |