|
本帖最后由 Yong Huang 于 2016-3-14 14:28 编辑
I think the method you described in msg #13 is a very good one. It can clearly show the actual mechanism Oracle works in fetching the data. Instead of 10046 event trace, 10202 event for "consistent read block header" may also be used and you don't have to flush buffer cache.
Apparently what you described is inconsistent with Jonathan Lewis's statement. On p.311 of his "Cost Based Oracle", he says
"The new mechanism finds the first row in the outer table, traverses the index, and stops in the leaf block, picking up just the relevant rowids for the inner table; then repeats for the second and third rows in the outer table. When all the target rowids have been found, the engine can sort them and then visit the inner table in a single pass, working along the length of the table just once, picking the rows in whatever order they happen to appear"
The new mechanism in this book published in 2006 refers to your second plan (see msg #6). The outer table is the one immediately below "NESTED LOOPS", such as DEPT or TBL_XLM_RXC in our case. Note he says "stops in the leaf block", not e.g. "stops before visiting the leaf block". Maybe over the years Oracle has changed the behavior even within the second plan (his "new mechanism"). You're sure your observation is on the second not third plan? |
|