25.01.2015 Views

Cost-Based Optimization of Integration Flows - Datenbanken ...

Cost-Based Optimization of Integration Flows - Datenbanken ...

Cost-Based Optimization of Integration Flows - Datenbanken ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6 On-Demand Re-<strong>Optimization</strong><br />

such that both directed re-optimization and full re-optimization results in the same plan.<br />

Hence, Theorem 6.2 holds.<br />

As a result <strong>of</strong> directed re-optimization, we minimized the re-optimization overhead for<br />

large plans and for optimization techniques with a large search space.<br />

6.3.2 Updating PlanOptTrees<br />

Due to directed re-optimization, where we only consider a subset <strong>of</strong> all plan operators, we<br />

need to incrementally update the existing PlanOptTree according to the rewritten plan.<br />

The extension <strong>of</strong> the optimizer interface is based on returning partial PlanOptTrees.<br />

Thus, after successful re-optimization, we incrementally update the PlanOptTree with<br />

the partial PlanOptTrees <strong>of</strong> the newly created subplans. More precisely, the problem is<br />

to update a given PlanOptTree that includes violated optimality conditions using a set <strong>of</strong><br />

given partial PlanOptTrees. The result <strong>of</strong> this update must be semantically equivalent to<br />

a full creation from scratch (A-IPC).<br />

We follow an approach called Partial PlanOptTree Replacement. We start bottom-up<br />

from all violated optimality conditions and remove those OCNodes except for transitively<br />

violated conditions because the new partial PlanOptTree is already aware <strong>of</strong> them. Subsequently,<br />

we traverse up the tree and remove all nodes that do not refer to at least one child<br />

any longer. As a result, we remove all nodes included in violated optimality conditions.<br />

Finally, we can apply the merging <strong>of</strong> partial PlanOptTrees for all new subplans similar to<br />

creating the initial PlanOptTree.<br />

Example 6.7 (Partial PlanOptTree Replacement). In Example 6.6, the optimality condition<br />

sel(o 2 ) ≤ sel(o 3 ) and the transitive condition sel(o 2 ) ≤ sel(o 4 ) were violated. The<br />

triggered re-optimization returned the partial PlanOptTree shown in Figure 6.8(a).<br />

o 4 o 2<br />

o 2 o 3<br />

o 4<br />

o 2<br />

o 3 o 4<br />

o 2<br />

|ds in1| |ds out1|<br />

|ds in1| |ds out1|<br />

|ds in1| |ds out1| |ds in1| |ds out1|<br />

|ds in1| |ds out1|<br />

|ds in1| |ds out1|<br />

|ds in1| |ds out1| |ds in1| |ds out1|<br />

|ds in1| |ds out1|<br />

sel(o4)<br />

sel(o2)<br />

sel(o2)<br />

sel(o3)<br />

sel(o4)<br />

sel(o2)<br />

sel(o3)<br />

sel(o4)<br />

sel(o2)<br />

≤<br />

(a) New Partial POT<br />

≤<br />

≤<br />

≤<br />

(b) POT during Replacement<br />

≤<br />

(c) POT after Replacement<br />

≤<br />

Figure 6.8: Partial PlanOptTree Replacement<br />

For an incremental update (Figure 6.8(b)), we remove the violated optimality condition<br />

sel(o 2 ) ≤ sel(o 3 ), the selectivity sel(o 2 ), operator o 2 and its statistics but before deletion,<br />

we copy the statistics to the new PlanOptTree. The additional arrows illustrate the traversal<br />

paths. We then merge the new partial PlanOptTree with the remaining PlanOptTree.<br />

Operator o 4 and all <strong>of</strong> its conditions are reused and the result is the PlanOptTree shown<br />

in Figure 6.8(c) representing plan optimality according to the statistics from Example 6.6.<br />

Algorithm 6.4 illustrates the details <strong>of</strong> the incremental update approach. For each<br />

optimality condition in the set <strong>of</strong> violated optimality conditions, we remove the OCNode<br />

and reachable statistic nodes without children (lines 2-7). Then, we clear strata 1-2<br />

180

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!