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: How to tune this query:

RE: How to tune this query:

From: Christian Antognini <Christian.Antognini_at_trivadis.com>
Date: Thu, 14 Dec 2006 20:08:05 +0100
Message-ID: <F2C9CCA71510B442AF71446CAE8AEBAF8B5681@MSXVS04.trivadis.com>


Hi Gene

> Thank you for your thoughts. I thought that the explain plan
indicated
> that the index OFFR_ALT8 will
> be read only for 1 partition based on this line in my explain plan:
>
> |* 14 | INDEX FAST FULL SCAN | OFFR_ALT8 | 20 |
480
> |
> 3 | KEY | KEY |
>
> I thought that KEY KEY indicated that it will only look at one
partition.
> Am I misinterpreting that?

Yes. The KEY KEY indicates that the pruning will be performed at runtime. This kind of access is chosen when at parse time it is not possible to determine which partition(s) will be accessed. To know how many partitions will be read you have to know how many times that specific operation will be executed and with which partition key. Notice that at runtime it is also possible that Oracle re-read the same partition multiple times.

Now, to know how many times that specific operation is executed, you have to look at its parent operation. In this case it is the PARTITION RANGE ITERATOR, which only provides the information that the optimizer expects to go through multiple partitions.

So, you have to have a look at the parent of PARTITION RANGE ITERATOR. In this case it is the NESTED LOOPS. Since the PARTITION RANGE ITERATOR is the second operation of the NESTED LOOPS (a.k.a. inner loop), it is executed for *each* row produced by the first operation (a.k.a. outer loop). In this the first operation is the MERGE JOIN CARTESIAN.

Therefore if the MERGE JOIN CARTESIAN returns, for example, 42 rows, the index fast full scan is basically executed 42 times.

HTH
Chris

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Dec 14 2006 - 13:08:05 CST

Original text of this message

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