Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> R: Tunning Select and Where statements

R: Tunning Select and Where statements

From: Riccardo Ferrari <riccardo.ferrari_at_informatica2.it>
Date: Thu, 14 Oct 1999 16:06:56 +0200
Message-ID: <7u4o7v$lpk$1@nslave1.tin.it>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US