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: ORDER BY - using index

Re: ORDER BY - using index

From: Jim Smith <jim_at_jimsmith.demon.co.uk>
Date: Tue, 7 Mar 2006 10:38:25 +0000
Message-ID: <1VOI3vVhKWDEFwVP@jimsmith.demon.co.uk>


In message <1141724467.219506.183180_at_j52g2000cwj.googlegroups.com>, boguslaw.pazur_at_marcos-bis.com.pl writes
>Hello.
>
>I have simply select with ORDER BY like
>SELECT x FROM y ORDER BY z
>Oracle (version 10.2) does not use index despite of there is index on
>column z. There are many records in table so SELECT takes long.

If you query has no where clause then Oracle has to retrieve all the rows in the table. In general, a full table scan is quicker than a full index scan plus a full table's worth of fetch by rowid.

Try it with and without hint and see which is actually quicker.

-- 
Jim Smith
I'm afraid you've mistaken me for someone who gives a damn.
Received on Tue Mar 07 2006 - 04:38:25 CST

Original text of this message

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