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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: CBO not using the index even though it is faster when hinted ....

RE: CBO not using the index even though it is faster when hinted ....

From: Robert Freeman <robertgfreeman_at_yahoo.com>
Date: Thu, 23 Jan 2003 20:54:38 -0800
Message-ID: <F001.00539411.20030123205438@fatcity.com>


I believe (pulling back my tuning memory which has been jump started of late) that
the order by is applied AFTER all the rows have been returned by the query. Thus,
your query is effectively this:

Select col1, col2, col3, blah1, blah2 from table;

Then the order by is applied. Since there is no predicate, no index is used, nor can
it be used. You might be able to use and index if you do something like this:

Select col1, col2, col3, blah1, blah2 from table where col1 >= min_val_col1 and col1 <= max_val_cols order by col1, col2, col3;

That should get you an index range scan. I think this will work. Someone please correct me if I'm wrong.

Robert

-----Original Message-----
Michael
Sent: Thursday, January 23, 2003 8:29 PM To: Multiple recipients of list ORACLE-L ....

Anyone have any problems with the CBO not using a index when you know it is faster by forcing a hint ?

I have set the following ...

Solaris
Oracle Version 8.1.7.4

block size = 8
DB_FILE_MULTIBLOCK_READ_COUNT = 8
mode = Choose

also using Tim Gormans 90 and 50 values for the other optimizer parms.

Select col1, col2, col3, blah1, blah2 from table order by col1, col2, col3;

Concatenate index on col1, col2, col3.

--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Johnson, Michael
  INET: Michael.Johnson_at_oln-afmc.af.mil

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L

(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Robert Freeman INET: robertgfreeman_at_yahoo.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).
Received on Thu Jan 23 2003 - 22:54:38 CST

Original text of this message

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