<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Bi-ob jective Optimization Framework for Query Plans</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Piotr Przymus</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Krzysztof Kaczmarski</string-name>
          <email>k.kaczmarski@mini.pw.edu.pl</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Krzysztof Stencel</string-name>
          <email>stencel@mimuw.edu.pl</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Nicolaus Copernicus University</institution>
          ,
          <country country="PL">Poland</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>The University of Warsaw</institution>
          ,
          <country country="PL">Poland</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>Warsaw University of Technology</institution>
          ,
          <country country="PL">Poland</country>
        </aff>
      </contrib-group>
      <fpage>342</fpage>
      <lpage>354</lpage>
      <abstract>
        <p>Graphics Processing Units (GPU) have significantly more applications than just rendering images. They are also used in generalpurpose computing to solve problems that can benefit from massive parallel processing. However, there are tasks that either hardly suit GPU or fit GPU only partially. The latter class is the focus of this paper. We elaborate on hybrid CPU/GPU computation and build optimisation methods that seek the equilibrium between these two computation platforms. The method is based on heuristic search for bi-objective Pareto optimal execution plans in presence of multiple concurrent queries. The underlying model mimics the commodity market where devices are producers and queries are consumers. The value of resources of computing devices is controlled by supply-and-demand laws. Our model of the optimization criteria allows finding solutions of problems not yet addressed in heterogeneous query processing. Furthermore, it also offers lower time complexity and higher accuracy than other methods.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>General-Purpose computing on Graphics Processing Units (GPGPU) involves
utilization of graphics processing units (GPU) in tasks traditionally handled
by central processing units (CPU). GPUs offer a notable processing power for
streams.</p>
      <p>
        Execution of database queries is an example of a successful application of
GPGPU. The current research focuses on using the GPU as a co-processor [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
GPU as co-processor may accelerate numerous database computations, e.g.
relational query processing, query optimization, database compression or supporting
time series databases [
        <xref ref-type="bibr" rid="ref13 ref14 ref5">5,13,14</xref>
        ].
      </p>
      <p>
        An application of GPU requires transferring data from the CPU memory
to the graphical device memory. The data transfer is usually time-consuming. It
may diminish the gain of the acceleration credited to GPU. This situation can be
improved by using lightweight compression methods that can significantly reduce
the costs associated with communication [
        <xref ref-type="bibr" rid="ref13 ref14">13,14</xref>
        ]. However, this does not solve all
the problems. In particular, GPU is optimized for numerical computation. Thus,
only selected operations will benefit from GPU. Small data sets are another
problem. For such sets the data transfer may dominate processing time and
destroy the performance gain. Therefore, joint processing capabilities of both
CPU and GPU are worth considering. Furthermore, as it is common to have
more than one GPU in a computer, a potential use of various GPU devices
should be considered. This type of query plans is called heterogeneous.
      </p>
      <p>
        The previous research efforts focused on the creation of query plans based
on a cost model. This approach finds plans with the best throughput. However,
it does not allow modelling all phenomena that can occur in heterogeneous
systems. Performing a query as soon as possible is not always cost effective [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. For
this reason, we propose a query processing model based on concepts of markets
that are known to be suitable for describing the interactions in a heterogeneous
world. They have already gained a considerable interest in the context of task
processing in heterogeneous systems [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. In market models, manufacturers
(processing devices) compete with each other for customers (query plans). Similar
competition occurs among customers.
      </p>
      <p>In this paper, we propose a query optimization model based on the
commodity market. A query plan is bi-objectively optimized to minimize: the processing
time and the value of consumed resources. For the user, a small difference in
execution time can be negligible. Thus, it is worth optimizing a query, so that
the execution time satisfies the user while other costs are minimized. In this case,
the cost may be, e.g. the responsiveness of the system, power consumption, heat
production, etc. One can also consider expressing the cost in financial terms.
2</p>
    </sec>
    <sec id="sec-2">
      <title>Preliminaries</title>
      <p>2.1</p>
      <sec id="sec-2-1">
        <title>GPU and Heterogeneous query processing</title>
        <p>From the parallel processing’s point of view, CPU accompanied by a GPU
coprocessor is a shared nothing architecture. A GPU card has its own memory or
a separate area in the CPU main memory. Thus, the data has to be explicitly
transferred from the CPU main memory to the GPU main memory. Similarly,
the results produced by GPU have to be transferred back to the CPU main
memory. This data transfer often introduces significant overhead. Thus, it is
important to include the transfer cost in the total execution time of an operation.
This cost is also a component of the execution time prediction.</p>
        <p>Contemporary computer systems often include more than one GPU. Then,
it is possible to combine multiple computational units in a single query plan.
Such plans are called heterogeneous query processing. Each device may have
a different communication cost (e.g. PCIe or shared memory) with the CPU
main memory. Furthermore, devices can often communicate directly between
each other. Therefore, the main problem of heterogeneous query processing is
the construction of such a query plan that uses only computational units from
which query performance will benefit most and yet will minimize used resources.</p>
        <p>
          Bress et. al. [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] identified problems of hybrid (CPU/GPU) query processing
which are also true in heterogeneous query processing:
Problem 1 Execution Time Prediction - as multiple database operations may
be executed concurrently it is hard to predict influence of concurrent tasks
on execution times.
        </p>
        <p>Problem 2 Critical Query - since the GPU memory, the concurrent GPU
kernels execution and the PCIe bus bandwidth are all limited, only the critical
queries should be selected to use GPU (i.e., queries that benefit from GPU
usage and are important from global perspective).</p>
        <p>Problem 3 Optimization Impact - as concurrent heterogeneous queries will
influence each other, it is important to consider this aspect in the planning
process.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Commodity market approach in query processing context</title>
        <p>
          In this paper we address these problems by showing that they may be solved by
applying a supply-and-demand pricing model taken from a commodity market.
In such a market resource owners (processing devices) price their assets and
charge their customers (queries) for consumed resources. Other pricing models
may also be used [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ].
        </p>
        <p>
          In the supply-and-demand model when supply (available resources) or
demand (needed resources) changes, the prices will be changed until an equilibrium
between supply and demand is found. Typically the value of a resource is
influenced by: its strength, physical cost, service overhead, demand and preferences
[
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. A consumer may be charged for various resources like CPU cycles, memory
used, the bus usage or the network usage. Typically, a broker mediates between
the resource owners and the consumer. The resource owners announce their
valuation and the resource quality information (e.g. estimated time) in response
to the broker’s enquiry. Then, the broker selects resources that meet the
consumer utility function and objectives, like cost and estimated time constraints
or minimization of one of the objectives.
2.3
        </p>
      </sec>
      <sec id="sec-2-3">
        <title>Bi-objective optimization</title>
        <p>
          Bi-objective optimization is a problem where optimal decisions need to be taken
in the presence of trade-offs between two conflicting objectives. It is a special
case of multiple criteria decision making. Typically there are no solutions that
meets all objectives. Thus, a definition of an optimum solution set should be
established. In this paper we use the predominant Pareto optimality [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. Given
a set of choices and a way of valuing them, the Pareto set consists of choices that
are Pareto efficient. A set of choices is said to be Pareto efficient if we cannot find
a reallocation of those choices such that the value of a single choice is improved
without worsening values of others choices. As bi-objective query optimization
is NP-hard, we need an approximate solution [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ].
3
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Heterogeneous Query Planer</title>
      <p>The main aim of the new query planner is to propose a solution to the
problems listed in Section 2.1, i.e., Execution Time Prediction, Critical Query and
Optimization Impact. Furthermore, this planner also addresses heterogeneous
GPU cards and distributed processing. In this paper we propose a method to
build heterogeneous query plans based on the economics of commodity markets.
It is characterized by the fact that the resource producers determine the cost
of their resources and resource consumers jostle for resources. Furthermore, the
resources owners provide information on the quality of their resources, i.e., the
estimated processing time.
3.1</p>
      <sec id="sec-3-1">
        <title>Notation</title>
        <p>Aou1i1 (D1); Aou2i2 (D2); Aou3i3 (D3); : : : ; Aounin (Dn)
Mu ;ui1 (D1); Mui1 ;ui2 (D2); Mui2 ;ui3 (D3); : : : ; Muin ;u (Dn)
(1)</p>
        <p>Fx(QShet) = X fx(Aou; D) +</p>
        <p>Aou(D)</p>
        <p>X
Mu0;u00 (D)
gx(Mu0;u00 ; D)
(2)
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Single Objective Heterogeneous Query Planer</title>
        <sec id="sec-3-2-1">
          <title>Procedure OptimalSeq(QSlog; u ; x)</title>
          <p>Input: QSlog = o1o2o3 : : : on - logical query sequence, u - base unit, x 2 f t
time, c - cost, b - bioptimization g - optimization type</p>
          <p>Result: QShybrid
1 seq_list = [];
2 for u in U do
3 Qu = Su(QSlog; u );
4 QFu = Fx(Qu) ;
5 append (u; Qu; QFu) to Seq_list;
6 end
7 QShybrid = pop minimum Qu (by QFu) sequence from Seq_list;
/* e.g. Ft(Qu) */
8 for (u, Qu, QFu) in Seq_list do
9 A, B, C = DiffSeq (QShybrid; Qu; u; x);
10 val; start; end = M axSubseq(A; B; C);
11 if val &gt; 0 then
12 Qhybrid(start : end) = Qu(start : end) ; /* subarray subsitution */
13 end
14 end
15 return Qbase</p>
          <p>In this section, we introduce the algorithm that searches for a heterogeneous
query plan, i.e., a plan that operates on more than two devices.</p>
          <p>For simplicity let us assume that x = t, ft(Aou; Di) = trun(Aou; Di) and
gt(Mu;u0 ; D) = tcopy(Mu;u0 ; D). Later in this article we will define functions
fc; gc and fb; gb to fit the model of the commodity market and the bi-objective
optimization. Let Su(QSlog; u ) return such QShet that each operation oi 2
QSlog is replaced with an algorithm from unit u algorithm pool, i.e., Aoui 2
APoi and the base device is set to u . Note that there is a specially designated
computing unit u from which the processing starts. It also collects the data in
the end of processing, since the GPU computing is controlled by a CPU side
program.</p>
          <p>The algorithm OptimalSeq starts by creating a query sequence for each
computing unit and estimating the processing cost for each item of this sequences
(lines 2-6). Next, one sequence (which minimizes Fx(Qu)) is selected as the base
sequence. It will be improved in later steps (line 7). Then, the algorithm iterates
over remaining query sequences in QShybrid in order to find such segments in
the remaining query sequences which improve original sequence (by replacing</p>
        </sec>
        <sec id="sec-3-2-2">
          <title>Procedure DiffSeq(seqbase; sequ; u; x)</title>
          <p>corresponding segment of the original sequence). This is done by calculating
the improvement and copy cost arrays in DiffSeq and finding maximal sequence
segment in MaxSubseq. A following variant of the proposed algorithm should
also be considered. Suppose that only one query sequence segment may be
inserted (i.e., choose one sequence segment from remaining k 1 sequences with
the biggest), this minimizes number of involved computational units and reduces
overall communication costs.</p>
          <p>
            The procedure DiffSeq simply calculates element wise difference between two
query sequences fx(Aoub ; Di) fx(Aou; Di) and copy costs from/to unit. The
procedure MaxSubseq is based on Kadane’s algorithm for maximum subarray
problem [
            <xref ref-type="bibr" rid="ref1">1</xref>
            ]. It scans through the improvement array, computing at each position the
maximum subsequence ending at this position. This subsequence is either empty
or consists of one more element than the maximum subsequence ending at the
previous position. Additionally, the copy to and copy from costs are included in
the calculation of the maximum subsequence (B and C arrays). The algorithm
returns the maximum improvement for a subsequence (which may be zero if the
subsequence does not improve the original query), the start and end items of
subsequence.
          </p>
          <p>The complexity of OptimalSeq is O(k n) where k is the number of devices
(usually small) and n is the number of operations of the sequence. Su,Fx, DiffSeq
and MaxSubseq have the complexity O(n).
3.3</p>
        </sec>
      </sec>
      <sec id="sec-3-3">
        <title>Economics in Heterogeneous Environment</title>
        <p>To cope with the problems mentioned in Section 2.1, additional criteria are
necessary – in this work an approach based on a simple economic model is
proposed. Each consumer (client) has a query budget that can be used to pay
for the resources used to process queries. Each computational unit is a service
provider (producer) of services available in units algorithm pool APui . Each
service provider establishes its own pricing for execution of any service from
APui . Pricing of the service depends on:
Procedure MaxSubseq(A, B, C)
– the estimation of needed resources (the size of the data D, the performance
of the task Aouii ),
– pricing of needed resources (the load of device ui – the greater the load on
the device, the higher cost of using the device),
– the preference of the device (e.g. device may prefer larger jobs and/or tasks
that give a greater acceleration on the GPU).</p>
        <p>First, pricing for using the resources of computational unit is established. This
depends on the previous load of the device: the higher demand for computational
unit, the higher price for using it. This is a periodic process which calculates
prices every tup seconds by calculating computational unit price Pu. Let 0 &lt;
Lcurr &lt; 1, 0 &lt; Lprev &lt; 1 be current and previous computational unit load
factors. Additionally, let Lth be a threshold below which prices should decrease,
and Pmin be the minimal price. Then the price is calculated using the following
formula4:
(max(Pmin; Pu (1 + (1 PuU) ) if ( P &gt; 0 ^
U &gt; 0) _ ( P &lt; 0);
Pu :=</p>
        <p>
          Pu
otherwise,
(3)
where Pu = Lcurrent Lthreshold and Uu = Lcurrent LP revious. This is
similar to the dynamic pricing model proposed in [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ] with exception to the
pricing formula i.e., we use max(Pmin; Pu (1+ (1 PuU) ) instead of max(Pmin; Pu
(1 + Pu)), this modification reduces the excessive growth of prices.
        </p>
        <p>
          To reflect the preference of the device in price we need to define a function
returning speedup factor between base device u (defined in the previous section)
4Slightly abusing notation we will also denote the new price by Pu.
and current device: speedup(Aou; Di) = trun(Aou ; Di)=trun(Aou; Di). Then we
define a cost function as crun(Aou; Di) = speedu#pD(Ai ou;Di) Pu, where speedu#pD(Ai ou;Di)
part combines the estimation of needed resources and the preference of the
device. A computational unit with high speedup on given operation will get a
discount per data size when pricing this operation. Similarly, operations with a
lower speedup factor will be charged more per quantity. Additionally it is
observed [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] that often speedup depends on the size of processed data (usually
low speed-up on small datasets) so discount depends on data size.
        </p>
        <p>It is also important to include cost of data transfer, let us define it as
if u,u’ share memory
ccopy(Mu;u0 ; D) :=
(0</p>
        <p>#Di
bandwidth(#Di;u;u0) (Pu + Pu0 )=2 otherwise
where bandwidth returns estimated bytes per second between u and u0
computational units. If direct data transfer is not available between u and u0 devices,
then transit device will be used (e.q. two GPU cards without direct memory
access will communicate using CPU RAM).</p>
        <p>Now let fc(Aou; Di) = crun(Aou; Di) and gc(Mu;u0 ; D) = ccopy(Mu;u0 ; D). A
solution minimizing the cost may be found under the previous assumptions and
using procedure OptimalSeq.
3.4</p>
      </sec>
      <sec id="sec-3-4">
        <title>Bi-objective Heterogeneous Query Planer</title>
        <p>
          As finding Pareto optimal bi-objective query plan is NP-hard (bi-objective
shortest path problem) [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ], we will use previously described OptimalSeq single
objective approximation algorithm and extend it to bi-objective case.
        </p>
        <p>
          We will use a priori articulation of preference approach which is often applied
to multi-objective optimization problems. It may be realized as the scalarization
of objectives, i.e., all objective functions are combined to form a single function.
In this work we will use weighted product method, where weights express user
preference [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ]. Let us define:
        </p>
        <p>
          fb(Aou; D) = crun(Aou; D)wc trun(Aou; D)wt ;
gb(Mu;u0 ; D) = ccopy(Mu;u0 ; D)wc tcopy(Mu;u0 ; D)wt :
where wt and wc are weights which reflect how important cost and time is (the
bigger the weight the more important the feature – values of fb; gb are higher
than 1). It is worth to mention that a special case with wt = wc = 1 (i.e., without
any preferences) is equivalent to Nash arbitration method (or objective product
method) [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ].
4
4.1
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Preliminary Experimental Results</title>
      <sec id="sec-4-1">
        <title>Simulation settings</title>
        <p>In order to evaluate this model we prepared a proof of concept and evaluated it
using custom developed simulation environment. Simulation environment was
deDevice o1 o2 o3 o4 o5 o6
GPU1 20 11 6 0.38 14 15
GPU2 5 11 6 0.33 4.66 5
CPU2 1 1 1.09 1 1.27 1.36
(a) Average speedup of operation
oi on given device compared to
CPU1</p>
        <p>Option</p>
        <p>Unit threshold
Unit minimal price</p>
        <p>CPU1 CPU2 GPU1 GPU2
0.75 0.75 0.4 0.4</p>
        <p>5 5 70 70
(b) Pricing model configuration
veloped using Python and SimPy framework. All presented experiments are
derived from simulation. There where four devices defined in environment: CPU1,
CPU2, GPU1, GPU2. Data transfer bandwidth between CPU* $ GPU* was
measured on real system, bandwidth of GPU1 $ GPU2 was calculated using
CPU1 as transit device. Following weights in bi-objective scalarization were used
wt = wc = 1 (i.e., without any preferences setting). Other settings of the
simulation environment are gathered in Tables 2b and 2a. Simulation environment
generates new query sequences, when spawn event occurs. Spawn event is
generated randomly in a fixed interval and generates randomly set of query sequences
(with fixed maximum). Every query sequence consists of maximally six
operations and operates on random data volume. In the simulation the processed
data size has a direct (linear) influence on processing speed. Each device has
got a limited number of resources; a database operation can be performed only
if needed resources are available. In other cases the operation is waiting. After
generating desired number of query sequences the simulation stops spawning of
new tasks and waits until all generated query sequences are processed.
4.2</p>
      </sec>
      <sec id="sec-4-2">
        <title>Simulation Results</title>
        <p>Figure 1a presents simulated execution time of three scheduling frameworks
processing a pool of generated sequences of queries. To each generated query
sequence an optimization criterion (time, cost or bi-optimization) was assigned
with equal probability 1=3. Optimization criteria are only used if query
scheduling framework supports it, otherwise default criteria is used. All scheduling
frameworks process exactly the same pool of generated query sequences.</p>
        <p>
          Compared frameworks are based on OptimalSeq algorithm but use different
objective function. Time objective planner uses only ft and gt functions as
optimization criteria; this means that it has no idea on load of each of devices. Self
Tuning Planner is based on idea presented in Breß et. al. [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ], i.e. it maintains a
list of observed execution times on data D for each algorithm Aouij . Observations
are interpolated (using e.q. cubic splines) to form new estimated execution time
function. And finally Bi-objective planner is a proof of concept implementation
of the model described in this work.
(a) Simulated efficiency of Bi-objective
Heterogeneous Query Planer, Time based
Query Planer and Self-Tuning Query
Planner
(b) Efficiency of Bi-objective
Heterogeneous Query Planer for various
optimization tasks
(c) Simulated load of devices (0 &lt; load &lt; 1)
(d) Pricing of device
        </p>
        <p>
          As expected Time Objective Planner is the slowest one since it has no
knowledge on the current load of devices. A solution suggested in [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] performs better.
However, there are two problems with this approach: first it adds an additional
overhead due to the interpolation of the observed execution times [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]; Secondly
as may be observed in 1a it takes some time before it adapts to a new
situation (in early stage it performs similarly to the Time Objective Planner). This
is due the fact that it does not immediately react to load change of the device.
Instead, it has to gather enough observations before adapting. The best
performance is gained when using Bi-objective planner, this is due to the three types
of optimization and the cost model which assures proper load balancing.
        </p>
        <p>As our framework support different types of optimization in the Figure 1b,
we present an impact of optimization type on processing performance. As it may
be observed, time optimization is the most appropriate for query processing with
high priority or with execution time constraint (like interactive queries or ad hoc
data mining). Cost optimization is appropriate for operations with low priority
or without time constraint (like batch processing or periodic jobs). Optimization
of both cost and time (without preferences) leads to moderate processing speed
but with better load balancing which is discussed later.</p>
        <p>As proposed economic model is an important part of presented framework,
in Figure 1 interaction between device load 1c and established device pricing 1d
is illustrated. Notice how increased load influences unit pricing according to
the formula 3. It is worth noting that pricing model may be tuned for specific
applications (see Table 2b for this simulation settings).
4.3</p>
      </sec>
      <sec id="sec-4-3">
        <title>Discussion</title>
        <p>
          In Section 2.1 we cite three challenges of Hybrid Query Processing initially
presented in Breß et.al. [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. As our bi-objective optimization framework was designed
in order to address this challenges, an evaluation in the context of the former
mentioned problems is needed. We address Critical Query problem by allowing
different optimization targets for queries. Choosing time optimisation allows to a
priori articulate importance of a query. Also, the bi-objective optimization tends
to promote queries which may gain more on particular devices (due to the
costdelay trade-off and the fact that the cost objective is designed to promote tasks
with greater speed-up 3.3). The problem of Execution Time Prediction is
addressed indirectly with bi-objective optimisation. This is because the bi-objective
optimisation combines the cost objective function, which uses a current device
load when pricing a device, with the execution time objective. So in most cases
it is preferred to optimize both cost and time (without preferences towards any)
through time/cost trade-off. Lastly different types of optimization apply also to
Optimization Impact challenge. Choosing optimization criteria specifies a
possible impact on other queries. Although, the preliminary results are promising
and seem to confirm this, an extended evaluation is needed in future.
5
        </p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Related Work</title>
      <p>
        Multiobjective query optimization was considered i.a. in Stonebraker et.al. [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]
where a wide-area distributed database system (called Mariposa) was presented.
An economic auction model was used as cost model. To process a query a user
supplied a cost-delay trade-off curve. Because defining this kind of input data was
problematic Papadimitriou et.al. proposed a new approach where an algorithm
for finding -Pareto optimal solutions was presented. The solution was that a
user would manually choose one of presented solutions. This work differs both
in an optimisation method and an economic model involved.
      </p>
      <p>In our framework a user supplies an optimization objective for a query a
priori (time, cost or bi-objective). Also as our model addresses the optimisation
of co-processing interaction a simpler commodity market model could be used
instead of a bidding model.</p>
      <p>
        An extended overview on utilization of a GPU as a coprocessor in database
operations may be found in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Breß et. al. [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] proposed a framework for
optimisation of hybrid CPU/GPU query plans and present two algorithms for
constructing hybrid query sequences. The first algorithm selected the fastest
algorithm for every element of a query sequence (including the cost of transfer
between devices) with complexity O(n). Unfortunately, this algorithm had two
flaws [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]: the constructed plan could generate too frequent data transfers
between devices, which may significantly affect the performance of data processing
and also an optimal plan was not always generated. To overcome those
problems they proposed the second algorithm. It searched for a continuous segment
of operations on GPU that could improve the base CPU sequence. In order to
find an optimal solution this algorithm generates all possible GPU sequences. Its
complexity is obviously higher: O(n2). Our work extends this approach by
allowing possible many various co-processing devices (Heterogeneous Query Planer in
Section 3.1). Secondly our work incorporates commodity market model as well
as bi-objective optimisation for better performance overcoming problems
mentioned in 2.1. Additionally, the algorithm OptimalSeq presented in our work may
be used to produce a similar solution as the second algorithm by Breß et.al.[
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]
but with better complexity (in case of two devices O(n)).
      </p>
      <p>
        It is worth to mention two surveys: the first one describing economic models
in grid computing [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and the second one describing methods for multi-objective
optimisation [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Conclusions and Future Work</title>
      <p>
        In this paper, we proposed a bi-objective optimization framework for
heterogeneous query plans. We also presented an algorithm for creating query sequences
in a heterogeneous environment with a single objective. This algorithm may be
used to construct query sequences similar to [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] but with better complexity. For
the purposes of this bi-objective optimization we designed a model including
time and cost objectives function. The cost objective function and pricing model
is build on foundations of commodity market economic model.
      </p>
      <p>The preliminary experiments are very promising. We achieved good load
balancing of the simulated devices combined with better optimization results.</p>
      <p>
        In future work, an extended evaluation of the presented framework is needed,
including; examination of parameters’ influence on the model behaviour, careful
assessment against Hybrid Query challenges. Another interesting field is
extension of this model beyond CPU/GPU co-processing. Finally, the framework will
be evaluated in a prototype time-series database [
        <xref ref-type="bibr" rid="ref13 ref14">14,13</xref>
        ].
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>J.</given-names>
            <surname>Bentley</surname>
          </string-name>
          .
          <article-title>Programming pearls: algorithm design techniques</article-title>
          .
          <source>Commun. ACM</source>
          ,
          <volume>27</volume>
          (
          <issue>9</issue>
          ):
          <fpage>865</fpage>
          -
          <lpage>873</lpage>
          , Sept.
          <year>1984</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>S.</given-names>
            <surname>Breß</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Beier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Rauhe</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Schallehn</surname>
          </string-name>
          , K.-U. Sattler, and
          <string-name>
            <given-names>G.</given-names>
            <surname>Saake</surname>
          </string-name>
          .
          <article-title>Automatic selection of processing units for coprocessing in databases</article-title>
          .
          <source>In Advances in Databases and Information Systems</source>
          , pages
          <fpage>57</fpage>
          -
          <lpage>70</lpage>
          . Springer,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>S.</given-names>
            <surname>Breß</surname>
          </string-name>
          ,
          <string-name>
            <given-names>I.</given-names>
            <surname>Geist</surname>
          </string-name>
          , E. Schallehn,
          <string-name>
            <given-names>M.</given-names>
            <surname>Mory</surname>
          </string-name>
          , and
          <string-name>
            <given-names>G.</given-names>
            <surname>Saake</surname>
          </string-name>
          .
          <article-title>A framework for cost based optimization of hybrid cpu/gpu query plans in database systems</article-title>
          .
          <source>Control and Cybernetics</source>
          , pages
          <fpage>27</fpage>
          -
          <lpage>35</lpage>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>S.</given-names>
            <surname>Breß</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Mohammad</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Schallehn</surname>
          </string-name>
          .
          <article-title>Self-tuning distribution of db-operations on hybrid cpu/gpu platforms</article-title>
          .
          <source>Grundlagen von Datenbanken, CEUR-WS</source>
          , pages
          <fpage>89</fpage>
          -
          <lpage>94</lpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>S.</given-names>
            <surname>Breß</surname>
          </string-name>
          , E. Schallehn,
          <string-name>
            <given-names>and I.</given-names>
            <surname>Geist</surname>
          </string-name>
          .
          <article-title>Towards optimization of hybrid cpu/gpu query plans in database systems</article-title>
          .
          <source>In New Trends in Databases and Information Systems</source>
          , pages
          <fpage>27</fpage>
          -
          <lpage>35</lpage>
          . Springer,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>R.</given-names>
            <surname>Buyya</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Abramson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Giddy</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Stockinger</surname>
          </string-name>
          .
          <article-title>Economic models for resource management and scheduling in grid computing</article-title>
          .
          <source>Concurrency and computation: practice and experience</source>
          ,
          <volume>14</volume>
          (
          <fpage>13</fpage>
          -15):
          <fpage>1507</fpage>
          -
          <lpage>1542</lpage>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>W.</given-names>
            <surname>Fang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>He</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Q.</given-names>
            <surname>Luo</surname>
          </string-name>
          .
          <article-title>Database compression on graphics processors</article-title>
          .
          <source>Proceedings of the VLDB Endowment</source>
          ,
          <volume>3</volume>
          (
          <issue>1</issue>
          -2):
          <fpage>670</fpage>
          -
          <lpage>680</lpage>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>D.</given-names>
            <surname>Florescu</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Kossmann</surname>
          </string-name>
          .
          <article-title>Rethinking cost and performance of database systems</article-title>
          .
          <source>ACM Sigmod Record</source>
          ,
          <volume>38</volume>
          (
          <issue>1</issue>
          ):
          <fpage>43</fpage>
          -
          <lpage>48</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>M. J. Franklin</surname>
            ,
            <given-names>B. T.</given-names>
          </string-name>
          <string-name>
            <surname>Jónsson</surname>
            , and
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Kossmann</surname>
          </string-name>
          .
          <article-title>Performance tradeoffs for clientserver query processing</article-title>
          .
          <source>In ACM SIGMOD Record</source>
          , volume
          <volume>25</volume>
          , pages
          <fpage>149</fpage>
          -
          <lpage>160</lpage>
          . ACM,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>D.</given-names>
            <surname>Kossmann</surname>
          </string-name>
          .
          <article-title>The state of the art in distributed query processing</article-title>
          .
          <source>ACM Computing Surveys (CSUR)</source>
          ,
          <volume>32</volume>
          (
          <issue>4</issue>
          ):
          <fpage>422</fpage>
          -
          <lpage>469</lpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. R. T. Marler and
          <string-name>
            <given-names>J. S.</given-names>
            <surname>Arora</surname>
          </string-name>
          .
          <article-title>Survey of multi-objective optimization methods for engineering</article-title>
          .
          <source>Structural and multidisciplinary optimization</source>
          ,
          <volume>26</volume>
          (
          <issue>6</issue>
          ):
          <fpage>369</fpage>
          -
          <lpage>395</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>C. H. Papadimitriou</surname>
            and
            <given-names>M.</given-names>
          </string-name>
          <string-name>
            <surname>Yannakakis</surname>
          </string-name>
          .
          <article-title>Multiobjective query optimization</article-title>
          .
          <source>In Proceedings of the twentieth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems</source>
          , pages
          <fpage>52</fpage>
          -
          <lpage>59</lpage>
          . ACM,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <given-names>P.</given-names>
            <surname>Przymus</surname>
          </string-name>
          and
          <string-name>
            <given-names>K.</given-names>
            <surname>Kaczmarski</surname>
          </string-name>
          .
          <article-title>Dynamic compression strategy for time series database using gpu</article-title>
          .
          <source>In New Trends in Databases and Information Systems. 17th East-European Conference on Advances in Databases and Information Systems September 1-4</source>
          ,
          <fpage>2013</fpage>
          - Genoa, Italy,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>P.</given-names>
            <surname>Przymus</surname>
          </string-name>
          and
          <string-name>
            <given-names>K.</given-names>
            <surname>Kaczmarski</surname>
          </string-name>
          .
          <article-title>Time series queries processing with gpu support</article-title>
          .
          <source>In New Trends in Databases and Information Systems. 17th East-European Conference on Advances in Databases and Information Systems September 1-4</source>
          ,
          <fpage>2013</fpage>
          - Genoa, Italy,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <given-names>A.</given-names>
            <surname>Raith</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Ehrgott</surname>
          </string-name>
          .
          <article-title>A comparison of solution strategies for biobjective shortest path problems</article-title>
          .
          <source>Computers &amp; Operations Research</source>
          ,
          <volume>36</volume>
          (
          <issue>4</issue>
          ):
          <fpage>1299</fpage>
          -
          <lpage>1331</lpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <given-names>O. O.</given-names>
            <surname>Sonmez</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Gursoy</surname>
          </string-name>
          .
          <article-title>Comparison of pricing policies for a computational grid market</article-title>
          .
          <source>In Parallel Processing and Applied Mathematics</source>
          , pages
          <fpage>766</fpage>
          -
          <lpage>773</lpage>
          . Springer,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>M. Stonebraker</surname>
            ,
            <given-names>P. M.</given-names>
          </string-name>
          <string-name>
            <surname>Aoki</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          <string-name>
            <surname>Litwin</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Pfeffer</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Sah</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          <string-name>
            <surname>Sidell</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Staelin</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Yu</surname>
          </string-name>
          .
          <article-title>Mariposa: a wide-area distributed database system</article-title>
          .
          <source>The VLDB Journal</source>
          ,
          <volume>5</volume>
          (
          <issue>1</issue>
          ):
          <fpage>48</fpage>
          -
          <lpage>63</lpage>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <given-names>T.</given-names>
            <surname>Westmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Kossmann</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Helmer</surname>
          </string-name>
          , and
          <string-name>
            <surname>G. Moerkotte.</surname>
          </string-name>
          <article-title>The implementation and performance of compressed databases</article-title>
          .
          <source>ACM SIGMOD Record</source>
          ,
          <volume>29</volume>
          (
          <issue>3</issue>
          ):
          <fpage>55</fpage>
          -
          <lpage>67</lpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>