Cost-Based Optimization of Integration Flows - Datenbanken ...
Cost-Based Optimization of Integration Flows - Datenbanken ...
Cost-Based Optimization of Integration Flows - Datenbanken ...
- No tags were found...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
6 On-Demand Re-<strong>Optimization</strong><br />
6.3.1 <strong>Optimization</strong> Algorithm<br />
Recall our search space shown in Figure 6.3. If certain optimality conditions are violated,<br />
we apply directed re-optimization according to those violations. At this point, we know<br />
the violated optimality conditions and the optimization techniques, which produced these<br />
conditions. For directed re-optimization, we additionally need to determine the minimal<br />
set <strong>of</strong> operators that should be reconsidered by those techniques. In this context, the<br />
transitivity property <strong>of</strong> the PlanOptTree must be taken into account.<br />
Example 6.6 (Determining Re-<strong>Optimization</strong> Search Space). Assume the PlanOptTree<br />
<strong>of</strong> our example. During initial optimization, selectivities <strong>of</strong> sel(o 2 ) = 0.2, sel(o 3 ) = 0.3<br />
and sel(o 4 ) = 0.4 resulted in the optimality conditions shown in Figure 6.7(a).<br />
o 2 o 3<br />
o 4<br />
o 2 o 3<br />
o 4<br />
|ds in1| |ds out1| |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(o2)<br />
sel(o3)<br />
sel(o4)<br />
sel(o2)<br />
sel(o3)<br />
sel(o4)<br />
≤<br />
≤<br />
≤<br />
≤<br />
(a) Initiating (Violated) OCNode<br />
(b) Transitive OCNode<br />
Figure 6.7: Determining Re-<strong>Optimization</strong> Potential<br />
Re-optimization was triggered because the selectivity <strong>of</strong> operator o 2 changed to sel(o 2 ) =<br />
0.45. Thus, we need to reconsider operators o 2 and o 3 during re-optimization. However,<br />
due to the transitivity <strong>of</strong> optimality conditions, we evaluate operator o 4 as well, because we<br />
do not know in advance if the implicit optimality condition <strong>of</strong> sel(o 2 ) ≤ sel(o 4 ) still holds.<br />
The PlanOptTree is traversed as shown in Figure 6.7(b) to determine that this transitive<br />
condition is violated as well.<br />
From a macroscopic view, we follow a bottom-up approach from the optimality conditions<br />
to determine all operators for directed re-optimization. We start at each violated<br />
optimality condition and traverse (without cycles) all other optimality conditions that<br />
are reachable over transitivity connections. Such a transitivity connection is defined as<br />
an atomic or complex statistic node connected with two or more optimality conditions.<br />
Transitivity chains <strong>of</strong> arbitrary length are possible, where the end is given by the lack <strong>of</strong><br />
transitive connections or by the first condition that is still optimal.<br />
Algorithm 6.3 illustrates how to trigger re-optimization. During statistics maintenance,<br />
all violated optimality conditions are added to the set OC. When triggering reoptimization,<br />
we traverse the logical transitivity chains for each optimality condition in<br />
OC. For the left operator <strong>of</strong> the optimality condition, we check the transitivity filter (direction<br />
<strong>of</strong> condition operands and its comparison operator) (line 4). If it holds, we check<br />
the transitive optimality filter for this reachable optimality condition (line 5). If optimality<br />
is violated, we mark this OCNode as a transitively violated condition, add it to OC<br />
(line 6) and proceed recursively along the left chain (line 7). This is done similarly for the<br />
right operator <strong>of</strong> the optimality condition (lines 8-12). Finally, we invoke the optimizer<br />
with the set OC. The optimizer uses the violated optimality conditions and all involved<br />
operators (line 13). Despite the unidirectional references <strong>of</strong> strata 1 and 2, we can efficiently<br />
determine these operators. After successful re-optimization, the PlanOptTree is<br />
178