<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">A Bi-objective Optimization Framework for Query Plans</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Piotr</forename><surname>Przymus</surname></persName>
							<affiliation key="aff0">
								<orgName type="institution">Nicolaus Copernicus University</orgName>
								<address>
									<country key="PL">Poland</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Krzysztof</forename><surname>Kaczmarski</surname></persName>
							<email>k.kaczmarski@mini.pw.edu.pl</email>
							<affiliation key="aff1">
								<orgName type="institution">Warsaw University of Technology</orgName>
								<address>
									<country key="PL">Poland</country>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Krzysztof</forename><surname>Stencel</surname></persName>
							<email>stencel@mimuw.edu.pl</email>
							<affiliation key="aff2">
								<orgName type="institution">The University of Warsaw</orgName>
								<address>
									<country key="PL">Poland</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">A Bi-objective Optimization Framework for Query Plans</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">15028261530DFFF68332F963F2940D92</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T18:46+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><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></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><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 <ref type="bibr" target="#b4">[5]</ref>. GPU as co-processor may accelerate numerous database computations, e.g. relational query processing, query optimization, database compression or supporting time series databases <ref type="bibr" target="#b4">[5,</ref><ref type="bibr" target="#b12">13,</ref><ref type="bibr" target="#b13">14]</ref>.</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 <ref type="bibr" target="#b12">[13,</ref><ref type="bibr" target="#b13">14]</ref>. 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 <ref type="bibr" target="#b7">[8]</ref>. 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 <ref type="bibr" target="#b5">[6]</ref>. 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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Preliminaries</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">GPU and Heterogeneous query processing</head><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. <ref type="bibr" target="#b4">[5]</ref> 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. 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). Problem 3 Optimization Impact -as concurrent heterogeneous queries will influence each other, it is important to consider this aspect in the planning process.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">Commodity market approach in query processing context</head><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.</p><p>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 <ref type="bibr" target="#b5">[6]</ref>.</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 <ref type="bibr" target="#b5">[6]</ref>. 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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3">Bi-objective optimization</head><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 <ref type="bibr" target="#b10">[11]</ref>. 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 <ref type="bibr" target="#b11">[12]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">Heterogeneous Query Planer</head><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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Notation</head><p>Table <ref type="table" target="#tab_0">1</ref> contains a summary of the notation used in this paper. Assume a set of units U , a logical query sequence QS log and a dataset D. The goal is to build a heterogeneous query sequence. Let QS het be a heterogeneous query sequence defined in Equation <ref type="bibr" target="#b0">(1)</ref>. Let D k+1 be the data returned by an operation</p><formula xml:id="formula_0">A o k ui k (D k ).</formula><p>The first row of QS het is created by replacing each operation o i ∈ QS log with an algorithm A oi uj ∈ AP oi . The second row is created by inserting an operation M u k ,u k (D) that copies the output of an algorithm on the unit u to the input of the current algorithm on the unit u .</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Symbol</head><p>Description U = {u1, u2, . . . un} set of computational units available to process data </p><formula xml:id="formula_1">D dataset Mu k ,u k (D) if u k = u k move D from u k to u k else pass oi ∈ O database operation oi from set of operations O A o i u k algorithm that computes the operation oi on u k APo i = {A o i u 1 , A o i u 2 , . . . ,</formula><formula xml:id="formula_2">QS het = A o 1 u i 1 (D1), A o 2 u i 2 (D2), A o 3 u i 3 (D3), . . . , A on u in (Dn) Mu * ,u i 1 (D1), Mu i 1 ,u i 2 (D2), Mu i 2 ,u i 3 (D3), . . . , Mu in ,u * (Dn)<label>(1)</label></formula><formula xml:id="formula_3">Fx(QS het ) = A o u (D) fx(A o u , D) + M u ,u (D) gx(M u ,u , D)<label>(2)</label></formula><p>3.  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</p><formula xml:id="formula_4">x = t, f t (A o u , D i ) = t run (A o u , D i ) and g t (M u,u , D) = t copy (M u,u , D).</formula><p>Later in this article we will define functions f c , g c and f b , g b to fit the model of the commodity market and the bi-objective optimization. Let S u (QS log , u * ) return such QS het that each operation o i ∈ QS log is replaced with an algorithm from unit u algorithm pool, i.e., A oi u ∈ AP oi 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 F x (Q u )) is selected as the base sequence. It will be improved in later steps (line 7). Then, the algorithm iterates over remaining query sequences in QS hybrid in order to find such segments in the remaining query sequences which improve original sequence (by replacing Procedure DiffSeq(seq base , seq u , u, x)</p><p>Input: seq base -base sequence, sequ -unit query sequence, usequ unit, x ∈ { t -time, c -cost, b -bioptimization } -optimization type Result: A -operations improvement array; B, C -copy to/from unit arrays 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><formula xml:id="formula_5">1 A, B, C = [], [], []; 2 for i in enumerate columns seq base do 3 A o u b (Di), Mu f ,u t (Di) = seq base [i]; 4 A o u (Di), Mu,u(Di) = sequ[i]; 5 append fx(A o u b , Di) − fx(A o u ,</formula><p>The procedure DiffSeq simply calculates element wise difference between two query sequences f</p><formula xml:id="formula_6">x (A o u b , D i ) − f x (A o u , D i )</formula><p>and copy costs from/to unit. The procedure MaxSubseq is based on Kadane's algorithm for maximum subarray problem <ref type="bibr" target="#b0">[1]</ref>. 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. S u ,F x , DiffSeq and MaxSubseq have the complexity O(n).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Economics in Heterogeneous Environment</head><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 AP ui . Each service provider establishes its own pricing for execution of any service from AP ui . Pricing of the service depends on:</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Procedure MaxSubseq(A, B, C)</head><p>Input: A -operations improvement array; B, C -copy to/from unit arrays Result: maximum_improvment, start, end 1 max_ending_here = max_so_far = 0 ; 2 begin = tbegin = end = 0 ; 3 for i, x in enumerate(A) do the estimation of needed resources (the size of the data D, the performance of the task A oi ui ), pricing of needed resources (the load of device u i -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 ∆t up seconds by calculating computational unit price P u . Let 0 &lt; L curr &lt; 1, 0 &lt; L prev &lt; 1 be current and previous computational unit load factors. Additionally, let L th be a threshold below which prices should decrease, and P min be the minimal price. Then the price is calculated using the following formula <ref type="foot" target="#foot_0">4</ref> :</p><formula xml:id="formula_7">Pu := max(Pmin, Pu • (1 + ∆Pu (1−∆U ) ) if (∆P &gt; 0 ∧ ∆U &gt; 0) ∨ (∆P &lt; 0), Pu otherwise,<label>(3)</label></formula><p>where ∆P u = L current − L threshold and ∆U u = L current − L P revious . This is similar to the dynamic pricing model proposed in <ref type="bibr" target="#b15">[16]</ref> with exception to the pricing formula i.e., we use max(P min , P u •(1+ ∆Pu (1−∆U ) ) instead of max(P min , P u • (1 + ∆P u )), 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) and current device:</p><formula xml:id="formula_8">speedup(A o u , D i ) = t run (A o u * , D i )/t run (A o u , D i ). Then we de- fine a cost function as c run (A o u , D i ) = #Di speedup(A o u ,Di) • P u , where #Di speedup(A o u ,Di)</formula><p>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 <ref type="bibr" target="#b12">[13]</ref> that often speedup depends on the size of processed data (usually low speed-up on small datasets) so discount depends on data size. It is also important to include cost of data transfer, let us define it as</p><formula xml:id="formula_9">c copy (M u,u , D) := 0 if u,u' share memory #Di bandwidth(#Di,u,u ) • (P u + P u )/2 otherwise</formula><p>where bandwidth returns estimated bytes per second between u and u computational units. If direct data transfer is not available between u and u devices, then transit device will be used (e.q. two GPU cards without direct memory access will communicate using CPU RAM). Now let</p><formula xml:id="formula_10">f c (A o u , D i ) = c run (A o u , D i ) and g c (M u,u , D) = c copy (M u,u , D).</formula><p>A solution minimizing the cost may be found under the previous assumptions and using procedure OptimalSeq.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.4">Bi-objective Heterogeneous Query Planer</head><p>As finding Pareto optimal bi-objective query plan is NP-hard (bi-objective shortest path problem) <ref type="bibr" target="#b11">[12]</ref>, 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 <ref type="bibr" target="#b10">[11]</ref>. Let us define:</p><formula xml:id="formula_11">f b (A o u , D) = c run (A o u , D) wc • t run (A o u , D) wt , g b (M u,u , D) = c copy (M u,u , D) wc • t copy (M u,u , D) wt .</formula><p>where w t and w c are weights which reflect how important cost and time is (the bigger the weight the more important the feature -values of f b , g b are higher than 1). It is worth to mention that a special case with w t = w c = 1 (i.e., without any preferences) is equivalent to Nash arbitration method (or objective product method) <ref type="bibr" target="#b10">[11]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Preliminary Experimental Results</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.1">Simulation settings</head><p>In order to evaluate this model we prepared a proof of concept and evaluated it using custom developed simulation environment. Simulation environment was de-  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 w t = w c = 1 (i.e., without any preferences setting). Other settings of the simulation environment are gathered in Tables <ref type="table" target="#tab_3">2b and 2a</ref>. 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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.2">Simulation Results</head><p>Figure <ref type="figure" target="#fig_3">1a</ref> 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. Compared frameworks are based on OptimalSeq algorithm but use different objective function. Time objective planner uses only f t and g t 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. <ref type="bibr" target="#b2">[3]</ref>, i.e. it maintains a list of observed execution times on data D for each algorithm A oi uj . 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. As expected Time Objective Planner is the slowest one since it has no knowledge on the current load of devices. A solution suggested in <ref type="bibr" target="#b2">[3]</ref> 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 <ref type="bibr" target="#b2">[3]</ref>; 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 <ref type="figure" target="#fig_3">1b</ref>, 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 <ref type="figure" target="#fig_3">1</ref> 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 <ref type="table" target="#tab_3">2b</ref> for this simulation settings).</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.3">Discussion</head><p>In Section 2.1 we cite three challenges of Hybrid Query Processing initially presented in Breß et.al. <ref type="bibr" target="#b2">[3]</ref>. 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.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5">Related Work</head><p>Multiobjective query optimization was considered i.a. in Stonebraker et.al. <ref type="bibr" target="#b16">[17]</ref> 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 <ref type="bibr" target="#b2">[3]</ref>. Breß et. al. <ref type="bibr" target="#b2">[3]</ref> 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 <ref type="bibr" target="#b2">[3]</ref>: 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(n 2 ). 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. <ref type="bibr" target="#b2">[3]</ref> 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 <ref type="bibr" target="#b5">[6]</ref> and the second one describing methods for multi-objective optimisation <ref type="bibr" target="#b10">[11]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">Conclusions and Future Work</head><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 <ref type="bibr" target="#b2">[3]</ref> 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 <ref type="bibr" target="#b13">[14,</ref><ref type="bibr" target="#b12">13]</ref>.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>9 A</head><label>9</label><figDesc>, B, C = DiffSeq (QS hybrid , Qu, u, x); 10 val, start, end = M axSubseq(A, B, C); 11 if val &gt; 0 then 12 Q hybrid (start : end) = Qu(start : end) ; /* subarray subsitution */ 13 end 14 end 15 return Q base</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head></head><label></label><figDesc>15 return max_so_far -C[end], begin, end</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Fig. 1 :</head><label>1</label><figDesc>Fig. 1: Simulation results. Note that time is in simulation ticks.</figDesc><graphic coords="10,126.60,278.31,184.32,138.24" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head>Table 1 :</head><label>1</label><figDesc>Symbols used in the definition of our optimisation model</figDesc><table /><note>A o i un } algorithm pool for the operation oi trun(A o i u j , D) estimated run time of the algorithm A o i u j on the data D tcopy(Mu i ,u j , D)) estimated copy time of the data D from ui to uj crun(A o i u j , D) estimated run cost of the algorithm A o i u j on the data D ccopy(Mu i ,u j , D) estimated copy cost of the data D from ui to uj QS log = o1o2 . . . on logical query sequence QS het heterogeneous query sequence see Eq. 1 ft, gt estimated algorithm run time and copy time see Sec. 3.2 fc, gc estimated algorithm run cost and copy cost see Sec. 3.3 f b , g b estimated algorithm run and copy bi-objective scalarization see Sec. 3.4 Fx(QS het ) sum of fx and gx over columns of QS het where x ∈ {t, c, b} see Eq. 2</note></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_1"><head></head><label></label><figDesc>2 Single Objective Heterogeneous Query Planer Procedure OptimalSeq(QS log , u * , x) Input: QS log = o1o2o3 . . . on -logical query sequence, u * -base unit, x ∈ { ttime, c -cost, b -bioptimization } -optimization type Result: QS hybrid 1 seq_list = [];</figDesc><table /><note>2 for u in U do 3 Qu = Su(QS log , u * ); 4 QFu = Fx(Qu) ; /* e.g. Ft(Qu) */ 5 append (u, Qu, QFu) to Seq_list; 6 end 7 QS hybrid = pop minimum Qu (by QFu) sequence from Seq_list; 8 for (u, Qu, QFu) in Seq_list do</note></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_3"><head>Table 2 :</head><label>2</label><figDesc>Simulation environment configuration veloped using Python and SimPy framework. All presented experiments are derived from simulation.</figDesc><table /></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="4" xml:id="foot_0">Slightly abusing notation we will also denote the new price by Pu.</note>
		</body>
		<back>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Programming pearls: algorithm design techniques</title>
		<author>
			<persName><forename type="first">J</forename><surname>Bentley</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Commun. ACM</title>
		<imprint>
			<biblScope unit="volume">27</biblScope>
			<biblScope unit="issue">9</biblScope>
			<biblScope unit="page" from="865" to="873" />
			<date type="published" when="1984-09">Sept. 1984</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Automatic selection of processing units for coprocessing in databases</title>
		<author>
			<persName><forename type="first">S</forename><surname>Breß</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Beier</surname></persName>
		</author>
		<author>
			<persName><forename type="first">H</forename><surname>Rauhe</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Schallehn</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K.-U</forename><surname>Sattler</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Saake</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Advances in Databases and Information Systems</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2012">2012</date>
			<biblScope unit="page" from="57" to="70" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">A framework for cost based optimization of hybrid cpu/gpu query plans in database systems</title>
		<author>
			<persName><forename type="first">S</forename><surname>Breß</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Geist</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Schallehn</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Mory</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Saake</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Control and Cybernetics</title>
		<imprint>
			<biblScope unit="page" from="27" to="35" />
			<date type="published" when="2013">2013</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Self-tuning distribution of db-operations on hybrid cpu/gpu platforms</title>
		<author>
			<persName><forename type="first">S</forename><surname>Breß</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Mohammad</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Schallehn</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Grundlagen von Datenbanken</title>
				<imprint>
			<date type="published" when="2012">2012</date>
			<biblScope unit="page" from="89" to="94" />
		</imprint>
	</monogr>
	<note>CEUR-WS</note>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">Towards optimization of hybrid cpu/gpu query plans in database systems</title>
		<author>
			<persName><forename type="first">S</forename><surname>Breß</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Schallehn</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Geist</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">New Trends in Databases and Information Systems</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2013">2013</date>
			<biblScope unit="page" from="27" to="35" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Economic models for resource management and scheduling in grid computing</title>
		<author>
			<persName><forename type="first">R</forename><surname>Buyya</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Abramson</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Giddy</surname></persName>
		</author>
		<author>
			<persName><forename type="first">H</forename><surname>Stockinger</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Concurrency and computation: practice and experience</title>
		<imprint>
			<biblScope unit="volume">14</biblScope>
			<biblScope unit="issue">13-15</biblScope>
			<biblScope unit="page" from="1507" to="1542" />
			<date type="published" when="2002">2002</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">Database compression on graphics processors</title>
		<author>
			<persName><forename type="first">W</forename><surname>Fang</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><surname>He</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Q</forename><surname>Luo</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Proceedings of the VLDB Endowment</title>
		<imprint>
			<biblScope unit="volume">3</biblScope>
			<biblScope unit="issue">1-2</biblScope>
			<biblScope unit="page" from="670" to="680" />
			<date type="published" when="2010">2010</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Rethinking cost and performance of database systems</title>
		<author>
			<persName><forename type="first">D</forename><surname>Florescu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Kossmann</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM Sigmod Record</title>
		<imprint>
			<biblScope unit="volume">38</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="43" to="48" />
			<date type="published" when="2009">2009</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Performance tradeoffs for clientserver query processing</title>
		<author>
			<persName><forename type="first">M</forename><forename type="middle">J</forename><surname>Franklin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><forename type="middle">T</forename><surname>Jónsson</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Kossmann</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM SIGMOD Record</title>
		<imprint>
			<biblScope unit="volume">25</biblScope>
			<biblScope unit="page" from="149" to="160" />
			<date type="published" when="1996">1996</date>
			<publisher>ACM</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">The state of the art in distributed query processing</title>
		<author>
			<persName><forename type="first">D</forename><surname>Kossmann</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM Computing Surveys (CSUR)</title>
		<imprint>
			<biblScope unit="volume">32</biblScope>
			<biblScope unit="issue">4</biblScope>
			<biblScope unit="page" from="422" to="469" />
			<date type="published" when="2000">2000</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">Survey of multi-objective optimization methods for engineering</title>
		<author>
			<persName><forename type="first">R</forename><forename type="middle">T</forename><surname>Marler</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">S</forename><surname>Arora</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Structural and multidisciplinary optimization</title>
		<imprint>
			<biblScope unit="volume">26</biblScope>
			<biblScope unit="issue">6</biblScope>
			<biblScope unit="page" from="369" to="395" />
			<date type="published" when="2004">2004</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<analytic>
		<title level="a" type="main">Multiobjective query optimization</title>
		<author>
			<persName><forename type="first">C</forename><forename type="middle">H</forename><surname>Papadimitriou</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Yannakakis</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the twentieth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems</title>
				<meeting>the twentieth ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems</meeting>
		<imprint>
			<publisher>ACM</publisher>
			<date type="published" when="2001">2001</date>
			<biblScope unit="page" from="52" to="59" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title level="a" type="main">Dynamic compression strategy for time series database using gpu</title>
		<author>
			<persName><forename type="first">P</forename><surname>Przymus</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Kaczmarski</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">New Trends in Databases and Information Systems. 17th East-European Conference on Advances in Databases and Information Systems</title>
				<meeting><address><addrLine>Genoa, Italy</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2013">September 1-4, 2013. 2013</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<analytic>
		<title level="a" type="main">Time series queries processing with gpu support</title>
		<author>
			<persName><forename type="first">P</forename><surname>Przymus</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Kaczmarski</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">New Trends in Databases and Information Systems. 17th East-European Conference on Advances in Databases and Information Systems</title>
				<meeting><address><addrLine>Genoa, Italy</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2013">September 1-4, 2013. 2013</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<analytic>
		<title level="a" type="main">A comparison of solution strategies for biobjective shortest path problems</title>
		<author>
			<persName><forename type="first">A</forename><surname>Raith</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Ehrgott</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Computers &amp; Operations Research</title>
		<imprint>
			<biblScope unit="volume">36</biblScope>
			<biblScope unit="issue">4</biblScope>
			<biblScope unit="page" from="1299" to="1331" />
			<date type="published" when="2009">2009</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b15">
	<analytic>
		<title level="a" type="main">Comparison of pricing policies for a computational grid market</title>
		<author>
			<persName><forename type="first">O</forename><forename type="middle">O</forename><surname>Sonmez</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Gursoy</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Parallel Processing and Applied Mathematics</title>
				<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2006">2006</date>
			<biblScope unit="page" from="766" to="773" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b16">
	<analytic>
		<title level="a" type="main">Mariposa: a wide-area distributed database system</title>
		<author>
			<persName><forename type="first">M</forename><surname>Stonebraker</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><forename type="middle">M</forename><surname>Aoki</surname></persName>
		</author>
		<author>
			<persName><forename type="first">W</forename><surname>Litwin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Pfeffer</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Sah</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Sidell</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Staelin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Yu</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">The VLDB Journal</title>
		<imprint>
			<biblScope unit="volume">5</biblScope>
			<biblScope unit="issue">1</biblScope>
			<biblScope unit="page" from="48" to="63" />
			<date type="published" when="1996">1996</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b17">
	<analytic>
		<title level="a" type="main">The implementation and performance of compressed databases</title>
		<author>
			<persName><forename type="first">T</forename><surname>Westmann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Kossmann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Helmer</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Moerkotte</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">ACM SIGMOD Record</title>
		<imprint>
			<biblScope unit="volume">29</biblScope>
			<biblScope unit="issue">3</biblScope>
			<biblScope unit="page" from="55" to="67" />
			<date type="published" when="2000">2000</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
