Database Reference
In-Depth Information
operations, and each of them has two children, you have a total of ten blocks. For example, for operation 3, the first
child consists of the lines from 4 to 12 (block G), and the second child consists of the lines from 13 to 16 (block J).
Note that in Figure 10-9 , each block is delimited by a frame. Finally, you need to find out in what order the blocks
are executed. To see how this is done, let's walk through the execution plan shown in Figure 10-9 and apply the rules
discussed previously:
1.
Operation 0 is a stand-alone operation, and its child (1) is executed before it.
2.
Operation 1 is a stand-alone operation, and its child (2) is executed before it.
3.
Operation 2 is a stand-alone operation, and its child (3) is executed before it.
4.
Operation 3 is a related-combine operation, and its children are executed before it. Since
the first child block (G) is executed before the second child block (J), let's continue with
the first operation (4) of the first child block (G).
5.
Operation 4 is an unrelated-combine operation, and its children are executed before it.
Since the first child block (E) is executed before the second child block (F), let's continue
with the first operation (5) of the first child block (E).
6.
Operation 5 is a related-combine operation, and its children are executed before it. Since
the first child block (C) is executed before the second child block (D), let's continue with
the first operation (6) of the first child block (C).
7.
Operation 6 is a related-combine operation, and its children are executed before it. Since
the first child block (A) is executed before the second child block (B), let's continue with
the first operation (7) of the first child block (A).
8.
Operation 7 is a stand-alone operation and has no children. This means that you have
finally found the first operation to be executed (hence it's in block A). The operation scans
a table and returns the rows to its parent operation (6).
9.
Block B is executed for each row returned by block A. In this block, operation 9 scans an
index at first, and operation 8 accesses a table with the returned rowids and finally returns
the rows to its parent operation (6).
10.
Operation 6 performs the join between the rows returned by blocks A and B and then
returns the result to its parent operation (5).
11.
Block D is executed for each row returned by block C. In other words, it's executed for each
row returned by operation 6 to its parent operation (5). In this block, operation 11 scans an
index initially. Then, operation 10 accesses a table with the returned rowids and returns
the rows to its parent operation (5).
12.
Operation 5 performs the join between the rows returned by the blocks C and D and then
returns the result to its parent operation (4).
13.
Operation 12 (block F) is executed only once. It scans a table and returns the result to its
parent operation (4).
14.
Operation 4 performs the join between the rows returned by the blocks E and F and then
returns the result to its parent operation (3).
Search WWH ::




Custom Search