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...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
6.3 Re-<strong>Optimization</strong><br />
at least the number <strong>of</strong> monitored statistics <strong>of</strong> one plan instance, i.e., the number<br />
<strong>of</strong> SNodes in the PlanOptTree (e.g., six in our example). The condition must be<br />
violated by a relative threshold τ and a true evaluation resets this lazy count.<br />
Algorithm 6.2 PlanOptTree Insert Statistics (A-PIS)<br />
Require: operator id nid, stat type type, statistic value, global variable lastopt<br />
1: if (on ← root.getOperator(nid)) = NULL or (sn ← on.getSNode(type)) = NULL then<br />
2: return // statistic not required<br />
3: sn.maintainAggregate(value)<br />
4: ret ← true<br />
5: if (time − ∆t) > lastopt then // min existence time<br />
6: clear memo<br />
7: for all cn ∈ sn.csnodes do // for each CSNode cn<br />
8: if memo.contains(cs) then<br />
9: continue<br />
10: ret ← ret and cs.computeStats(), memo.put(cs)<br />
11: for all oc ∈ sn.ocnodes do // for each OCNode oc<br />
12: if memo.contains(oc) then<br />
13: continue<br />
14: ret ← ret and oc.isOptimal(), memo.put(oc)<br />
15: if ¬ret then<br />
16: A-PTR() // actively triggering re-optimization (start reopt thread)<br />
Algorithm 6.2 illustrates the statistics maintenance using a PlanOptTree and shows how<br />
to trigger re-optimization if workload characteristics change over time. Starting from the<br />
root, we identify the operator node according to the given nid. We decline the maintenance<br />
<strong>of</strong> a statistic if it is not required by the PlanOptTree (lines 1-2). Then, we get the<br />
specific statistic node and maintain the aggregate (line 3). If the minimum existence time<br />
is exceeded, we check the existing optimality conditions. For this purpose, we use our<br />
MEMO structure, recursively compute complex statistic measures, and check all reachable<br />
optimality conditions (lines 6-14). Materialization <strong>of</strong> complex statistics is applied with<br />
awareness <strong>of</strong> the PlanOptTree structure in order to prevent anomalies (e.g., inconsistency<br />
<strong>of</strong> statistics in one optimality condition). We do not miss any violated condition when<br />
using the MEMO structure because this algorithm is executed for each atomic statistic value.<br />
In case there is a violated optimality condition, we trigger re-optimization (line 16).<br />
In conclusion, we evaluate optimality conditions as we gather new statistics, and reoptimization<br />
is triggered only if optimality conditions are violated. In contrast to periodical<br />
re-optimization, this yields (1) minimal statistics maintenance, (2) the avoidance <strong>of</strong><br />
unnecessary re-optimization steps, and (3) an immediate adaptation to changing workload<br />
characteristics, and hence, it results in a lower overall execution time.<br />
6.3 Re-<strong>Optimization</strong><br />
Once re-optimization has been triggered by violated optimality conditions, we re-optimize<br />
the current plan. This includes two major challenges. First, we apply directed reoptimization<br />
rather than full re-optimization. Second, after successful re-optimization,<br />
we incrementally update the existing PlanOptTree according to the new conditions.<br />
177