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 -> Re: Tunning Select and Where statements

Re: Tunning Select and Where statements

From: <michael_bialik_at_my-deja.com>
Date: Tue, 28 Sep 1999 22:03:09 GMT
Message-ID: <7srdun$s73$1@nnrp1.deja.com>


In article <7sq3av$9ap_at_romeo.logica.co.uk>,   "Ming" <fungs_at_logica.com> wrote:
> Given the following statement :-
>
> 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.
>

-- I guess you meann 'age' and 'name'.

   In that case Oracle is using INDEX_ONLY access ( all fields from    select list and where clause are in the same index ).    The index entries are smaller the data rows, so in one I/O it may    read more data.

> Thanks for any Help
>
> Ming.
>

  Good luck. Michael.

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Tue Sep 28 1999 - 17:03:09 CDT

Original text of this message

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