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.
4.3 <strong>Cost</strong>-<strong>Based</strong> Vectorization<br />
the related complexity analysis, (2) we introduced the parameter λ in order to adjust the<br />
computation approaches, and (3) we integrated this heuristic algorithm into our overall<br />
cost-based optimization framework.<br />
Optimality Analysis<br />
As already mentioned, the optimality <strong>of</strong> the vectorized plan depends on (1) the costs<br />
<strong>of</strong> the single operators, (2) the CPU utilization <strong>of</strong> each operator and (3) the available<br />
resources (possible parallelism). However, the A-CPV only takes the costs from (1) into<br />
consideration. Nevertheless, we can give optimality guarantees for this heuristic approach.<br />
The algorithm can be parameterized with respect to the hardware resources (3). If<br />
we want to force the single-threaded execution, we simply set λ to λ ≥ ∑ m<br />
i=1 W (o i) −<br />
max m i=1 W (o i). If we want to force the highest meaningful degree <strong>of</strong> parallelism (this is<br />
not necessarily a full vectorization), we simply set λ = 0.<br />
Now, assuming the given λ configuration, the question is, which optimality guarantee we<br />
can give for the solution <strong>of</strong> the cost-based plan vectorization algorithm 10 . For this purpose,<br />
R e (o i ) denotes the empirical CPU utilization (measured with a specific configuration) <strong>of</strong> an<br />
operator o i with 0 ≤ R e (o i ) ≤ 1, and R o (o i ) denotes the maximal resource consumption <strong>of</strong><br />
an operator o i with 0 ≤ R o (o i ) ≤ 1. Here, R o (o i ) = 1 means that the operator o i exhibits<br />
an average CPU utilization <strong>of</strong> 100 percent. In fact, the condition ∑ m<br />
i=1 R e(o i ) ≤ 1 must<br />
hold.<br />
Obviously, for an instance-based plan P , we can write R e (o i ) = R o (o i ) because all<br />
operators are executed in sequence and thus, do not influence each other. When we<br />
vectorize P to a fully vectorized plan P ′ , with a maximum <strong>of</strong> R e (o ′ i ) = 1/m, we have to<br />
compute the costs with W (o ′ i ) = R o(o i )/R e (o ′ i ) · W (o i). When we merge two execution<br />
buckets b ′ i and b′ i+1 during cost-based plan vectorization, we compute the effective CPU<br />
utilization R e (b ′′<br />
i ) = 1/|b|, the maximal CPU utilization R o(b ′′<br />
i ) = (W (b′ i )·R o(b ′ i )+W (b′ i+1 )·<br />
R o (b ′ i+1 ))/(W (b′ i ) + W (b′ i+1 )), and the cost<br />
⎧<br />
R e (b<br />
⎪⎨<br />
′ i )<br />
W (b ′′ R<br />
i ) = e (b ′′<br />
i ) · W (b′ i) + R e(b ′ i+1 )<br />
R e (b ′′<br />
i+1 ) · W (b′ i+1) R e (b ′′<br />
i ) ≤ R o(b ′′<br />
i )<br />
R o (b ⎪⎩<br />
′ i )<br />
R o (b ′′<br />
i ) · W (b′ i) + R o(b ′ i+1 )<br />
(4.15)<br />
R o (b ′′<br />
i+1 ) · W (b′ i+1) otherwise.<br />
We made the assumption that each execution bucket gets the same maximal empirical<br />
CPU utilization R e (b ′′<br />
i ), that resources are not exchanged between those buckets, and we<br />
do not take the temporal overlap into consideration. However, we can give the following<br />
guarantee, while optimality cannot be ensured due to the heuristic character <strong>of</strong> the A-CPV<br />
(see Theorem 4.3).<br />
Theorem 4.4. The A-CPV solves (1) the P-CPV, and (2) the constrained P-CPV with<br />
guarantees <strong>of</strong> W (P ′′ ) ≤ W (P ) and W (P ′′ ) ≤ W (P ′ ) under the restriction <strong>of</strong> λ = 0.<br />
Pro<strong>of</strong>. As a precondition, it is important to note that, for the case <strong>of</strong> λ = 0, the A-CPV<br />
cannot result in a plan with k = 1 (although this is a special case <strong>of</strong> the P-CPV) due to<br />
the maximum rule <strong>of</strong> ∑ |b k |<br />
c=1 W (o c) + W (o j ) ≤ max (Algorithm 4.3, line 10). Hence, in<br />
10 For this optimality analysis, we use a slightly different notation <strong>of</strong> operators o i and execution buckets<br />
b i in order to clearly distinguish the three different execution models. Let o i denote instance-based<br />
execution, o ′ i denote full vectorized execution, and o ′′<br />
i denote cost-based vectorized execution.<br />
109