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

Home -> Community -> Mailing Lists -> Oracle-L -> deciding which query plan to use

deciding which query plan to use

From: <ryan.gaffuri_at_cox.net>
Date: Wed, 14 Apr 2004 8:04:59 -0400
Message-Id: <20040414120459.OOPZ10703.lakermmtao12.cox.net@smtp.central.cox.net>


It wouldn't really do me much good to send you the plan or the query, since there is alot of business specific information in it and its a long query. This is a rather odd case.

The problem is that I am joining on a column that has about 120 distinct values out of about 3 million records. Oracle is choosing a full tablescan on tableA and an index range scan on tableB (both tables have similiar data distribution).

This results in about 170,000 Logical I/Os.

If I force an index scan on tableA, then I can get that down to 9000 logical I/Os. No brainer right?

However, when I use runstats_pkg, overall resource usage is about 234,000 higher with the full tablescan an the 170,000 logical I/Os.

Anyone ever run into this situation? Where logical I/Os are radically reduced, but overall stress on the system is radically increased?

The query it self is over the form:

select cols
from tab1, tab2
where tabl1.col = tab2.col
and tab2.col = <value>

the join column has very few distinct values. That is the whole bottleneck. Its just tough to decide what is better? Lower Logical I/Os or lower overall latch usage?



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Wed Apr 14 2004 - 07:01:33 CDT

Original text of this message

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