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 />
presented in Section 2.2, this underlying problem <strong>of</strong> a black-box optimizer makes directed<br />
re-optimization impossible and the suboptimality <strong>of</strong> the current plan cannot be guaranteed<br />
and thus unnecessary re-optimization steps might be triggered. This problem is also<br />
present for approaches <strong>of</strong> parametric query optimization (PQO). <strong>Based</strong> on the assumption<br />
<strong>of</strong> unknown query parameters and thus, uncertain statistics during query compilation time<br />
(e.g., for stored procedures), PQO [INSS92, HS02, HS03] optimizes a given query into all<br />
candidate plans by exhaustively determining the optimal plans for each possible parameter<br />
combination (the complete search space) at compile time. The current statistics are used<br />
to pick the plan that is optimal for the given parameters at execution time. In contrast<br />
to full search space exploration, Progressive PQO (PPQO) [BBD09] aims to iteratively<br />
explore the search space over multiple executions <strong>of</strong> the same query in order to reduce the<br />
optimization overhead. Although this approach is advantageous compared to traditional<br />
query optimization, it models the complete parameter search space instead <strong>of</strong> the search<br />
space <strong>of</strong> an individual optimal plan, does not allow for directed re-optimization, does not<br />
guarantee to find the optimal plan, and does not address the challenge <strong>of</strong> when and how<br />
to trigger re-optimization.<br />
The major research question is if we could exploit context knowledge from the optimizer,<br />
in terms <strong>of</strong> optimality conditions <strong>of</strong> a deployed plan, to do just enough for re-optimization.<br />
In order to address the mentioned problems, we introduce the on-demand re-optimization.<br />
On-Demand Re-<strong>Optimization</strong><br />
Our vision <strong>of</strong> on-demand re-optimization is (1) to model optimality <strong>of</strong> a plan by its optimality<br />
conditions rather than considering the complete search space, (2) to monitor only<br />
statistics that are included in these conditions, and (3) to use directed re-optimization if<br />
conditions are violated. We use an example to illustrate the idea.<br />
Example 6.2 (On-Demand Re-<strong>Optimization</strong>). Assume a subplan P 5 (o 2 , o 3 ) (Figure 6.3(a))<br />
and a search space as shown in Figure 6.3(b), where the dimensions represent the selectivities<br />
sel(o 2 ) and sel(o 3 ). In order to validate the optimality <strong>of</strong> the plan (o 2 , o 3 ), we<br />
continuously observe the optimality condition oc 1 : sel(o 2 ) ≤ sel(o 3 ), where we only monitor<br />
statistics included in such optimality conditions. If an optimality conditions is violated,<br />
we can use directed re-optimization in order to determine the new optimal plan.<br />
Selection (o2)<br />
[in: msg1, out: msg2]<br />
Selection (o3)<br />
[in: msg2, out: msg3]<br />
Selection (o4)<br />
[in: msg3, out: msg4]<br />
oc 1<br />
oc 2<br />
oc 3<br />
2<br />
monitored<br />
statistics<br />
sel(o 2)<br />
1<br />
0<br />
P’ (o 3, o 2)<br />
3<br />
directed<br />
re-opt<br />
1<br />
sel(o 3)<br />
optimality<br />
condition oc1:<br />
Opt Plan<br />
P<br />
(o 2, o 3)<br />
1<br />
sel(o 2) ≤<br />
sel(o 3)<br />
sel(o 2)<br />
1<br />
0<br />
oc2:<br />
sel(o 3) ≤<br />
sel(o 4)<br />
(o 3,o 4,o 2)<br />
(o 3,o 2,o 4)<br />
Opt Plan (o<br />
P 2,o 4,o 3)<br />
(o 2,o 3,o 4)<br />
sel(o 3)<br />
(o 4,o 3,o 2)<br />
(o 4,o 2,o 3)<br />
oc1:<br />
sel(o 2) ≤<br />
sel(o 3)<br />
oc3:<br />
sel(o 2) ≤<br />
sel(o 4)<br />
1<br />
with<br />
sel(o 4)=0.6<br />
(a) Subplan P 5(o 2, o 3, o 4)<br />
(b) Plan Diagram <strong>of</strong> P 5(o 2, o 3)<br />
(c) Plan Diagram <strong>of</strong> P 5(o 2, o 3, o 4)<br />
Figure 6.3: Partitioning <strong>of</strong> a Plan Search Space<br />
Note that we maintain the optimal plan and its optimality conditions (oc 1 -oc 3 ) as shown<br />
in Figure 6.3(c) for subplan (o 2 , o 3 , o 4 ) but we do not explore the complete search space.<br />
170