Your SlideShare is downloading. ×
20110516_ria_ENC
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

20110516_ria_ENC

161
views

Published on

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
161
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • This is basically the summary of the entire paper\n
  • \n
  • \n
  • \n
  • Result: algebraic query tree that optimizes the order in which operators must be applied. \nTree A is not the best plan because the selection operation is applied before the join.\nTree B is the optimal algebraic plan because all selection and projection operations are applied as soon as possible\n\n
  • In an ubiquitous environment, there are no global views because it’s expensive!\n\n
  • Given: Algebraic Tree (from logical optimized) \nResult: All corresponding execution plans that specify the implementation of each algebraic operator\n\n
  • - Classical query optimization techniques typically generate execution plans that are optimized according to a single dimension, query execution time.\n- Useful knowledge must be obtained from previously executed queries and be managed and exploited by means of automatic learning techniques\n- GOAL: improve or acquire new capabilities from experience related to some specific tasks\n- Query evaluation time is no longer the main optimization objective\n
  • Given a new query Q, an existent query plan is retrieved if it can be adapted to Q. Also, it is required to verify if it is possible to accomplish its execution with the computational resources available at the moment of query execution (mem, CPU, energy)\n
  • \n
  • \n
  • \n
  • It is also necessary to pay attention on the computational resources consumed by the query and those that are available at the moment that the new query will be executed as well as in the optimization objective that can change each time the query is executed.\n
  • \n
  • \n
  • \n
  • The operator and the attribute value are not important to determine the operation family to which a specific operation pertains, the important knowledge is related to the operation type and the attribute(s) included in the operations\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Similarity of a and b is defined in terms of features common to a and b\nminus the features that pertain to a but not to b\nand those that pertain to b but not to a\ntheta, alpha, beta : non-negative valued parameters that determine the relative weight of the three components of similarity\n- provide the flexibility when modifying the importance of similarities or differences accdng to area of application\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. Query Optimization UsingCase-based Reasoning inUbiquitous Environments Lourdes Angelica Martinez-Medina Christophe Bibineau Jose Luis Zevhinelli-Martini 2009 Mexican International Conference on Computer Science (ENC 09) 2011/05/16 - Ria Mae Borromeo
    • 2. Introduction Query Optimization  Rely on cost models that are dependent on metadata (statistics, cardinality estimates)  Typically restricted to execution time estimation Problem  There are computational environments where metadata acquisition and support are expensive.  i.e. Ubiquitous environments Proposed Solution  Query Optimization technique based on learning, particularly case-based reasoning 2
    • 3. Ubiquitous Environment Integrates information from different computational tools and application Characteristics 1. Heterogeneity ( ) • extensive range of computational resources and electronic devices • devices have different physical and logical characteristics 2. Dynamicity ( ) • resources change continuously due to mobility • communication network properties and the resources that interact with it vary 3
    • 4. Ubiquitous Environment3. Distribution ( ) • resources are distributed within a physical space thus information used by these resources are also distributed4. Autonomy ( ) • resources can change their availability status anytime6. Physical Constraints ( ) • i.e.: processing and storage capability, energy consumption, location7. Metadata lack ( ) • Constant changes --> Expensive maintenance --> No global schema 4
    • 5. ill be available again. is composed by three phases: logical, global, and physical s. Resources present physical lim- Logical and physical optimization phases are related to cen Classical Query Optimizationain their appropriate operation, e.g. rage capability, energy consump- tralized environments. Global optimization is required in distributed environment. Figure 1 illustrates the optimizationng others. A device or a process is phases of the typical optimization process. e a task only if it counts with the  Evaluation cost models used ational resources. It is convenient for most of classical querysk performance based on specific optimization techniques are he resource characteristics previ- tightly tied to metadatamake difficult the acquisition and use.tadata like cardinality and statisticsalues. There is not a global schema  Each phase requires utational environments, its mainte- nsive different constant changes due to the metadata types and has differentational environments metadata ac- optimization objectives ce is very expensive. Ubiquitous must provide a set of methods tom available resources. The proper- ources in ubiquitous environment s for query processing. Some of Figure 1. Phases of the optimization process metadata required for estimatingxecution plans (possible execution 5esults of a query) as a result of
    • 6. Classical Query Optimization Logical Optimization  Aims to reduce the number of tuples combined as intermediate results  Appropriate order for applying selection, projection and join operators must be decided  Uses heuristics and metadata  Result: Figure 2. Algebraic query trees 6
    • 7. Classical Query Optimization Global Optimization  Aims to minimize communication cost related to interactions among resources and a set of views  Global optimizer: decides where to perform each part of the execution tree  Result: new execution tree with communication operators 7
    • 8. Classical Query Optimization  Physical Optimization  Aims to reduce disk access for retrieving requested data and minimize execution time for executing query plans  Metadata related to execution context is required Figure 2. Algebraic query trees Algebraic query trees 8timization Figure 3. Query execution plan
    • 9. Contribution of the Paper Proposes a query optimization technique for ubiquitous environments Allows query optimization according to user requirements Query optimization based on learning  Goal: Improve or acquire new capabilities rom experience related some specific tasks 9
    • 10. Query Optimization Based on Learning Learn from past experience!  Experience : the knowledge gained from a problem resolution  Learning : the acquisition of knowledge in order to improve the behavior or to acquire new capabilities from previous experiences  Machine Learning : a sub-discipline of AI that is in-charge of designing and developing methods that allow computers to automatically learn in order to improve or create specific capabilities 10
    • 11. Case-based Reasoning Proposes a reasoning process that aims to solve new problems using the experience gained when similar problems are solved Case minimum unit of reasoning Problem Description Solution Set of annotations that describe how the solution was derived 11
    • 12. consists of (i) a problem description, (ii) its correspondentsolution, and, (iii) a set of annotations that describe how s Case-based Reasoning Processthe solution was derived. Case based reasoning has been tformalized as a four-step process: retrieve, reuse, review andretain [7].(4) Store as a new (1) Get relevant casescase in the memory (2) Adjust the solution(3) New solution must of the relevant casebe verified in the real to the problemworld (simulation) Figure 4. Case-based reasoning process 12
    • 13. Case-based Reasoning Adaptation to Query Optimization Adapts case-based reasoning to provide optimal execution plans for new queries Uses the knowledge acquired from experience to optimize and execute similar queries The solution is represented by the current execution plan: 1. Query 2. Problem 3. Case 4. Reasoning Process 13
    • 14. to solve new The whereClause specifies the set of conditions (for datamilar problemsf reasoning. It 1. Query selection and data combination or join) that must be verified by the data to form part of the query result. correspondent Figure 5 illustrates the model that we propose for repre- describe how  Modular part of knowledge in the definition of and join operations are senting a query. In a query, selection a problem & case ning haspiece of knowledge that links amost frequent. the existing  The been the most important and problem withuse, cases and review  selectClause  fromClause  whereClause Query Representation (UML Diagram) Figure 5. Query representation (UML diagram)ss 14
    • 15. 1. Query Query Operation  Type  Select condition(atttexp, cnstexp)  Join condition(attrexp.a, attrexp.b)  Set of attributes  Specific Condition Q = {O1, O2, O3, O4 } SELECT Rest.nom FROM Resto, Ville, Region WHERE Region.nom = ‘RA’ O1 AND Resto.spec = ‘IT’ O2 AND Resto.vil = Ville.nom O3 AND Ville.numDep = Region.numDep O4 15
    • 16. We propose the concept of operation family in ord 1. Query group operations that include the same condition applie the same attributes and for this reason, the same relatTwo operations ox and oy pertain to the same oper Operation Family family if they associated to asame operation families or join)  All queries are are of the set of type (selection  Used to group operations that include the same condition involve thethe sameattributesand sameof them must pertain applied to same attributes (each relations theTwo operations Ox and Oy respectively). An operation fami  same data source are from the same operation family if: represented as follows:  same operation type (selection or join)  same attributes (1) R.an = {on | on = condition(R.an ,value)} an attribute that pertains The operation set operations family is composed by R.an the relation R tooperations set on with a condition of thecondition(R.an , value), where an is an attribute 16
    • 17. of all possible comparison operators: Equal, EqualOrLower, set. These operations are members of different operation the T p Lower, GreaterOrEqual, Greater and Different. All the families: R1.a1 , R2.a2 and R1.a3,R2.a4 . Equation (2) inclu 1. Query queries are associated to a set of operation families. The shows the operationa familiesQ is that are associated to each Q defined by an operations with unde whereClause of query simi requi operations in Q. set. These operations are members of different operation solv  The whereClause ,of a query Q is defined by. an operations set Th families: R1.a1 R2.a2 and R1.a3,R2.a4 Equation (2) within of (On) Q the { shows = operation families Q that are ,associated to } (2) R1.a1 , R2.a2 , R1.a3,R2.a4 R2.a4,R3.a5 each com simil  These operations are members of different operation families operations in Q. that solve  Operation families associated to each operation in Q Each different combination of operation families R.an of int exec conforms a = { R1.a1 , R2.a2 , i.e. the class R2.a4,R3.a5 } by comp (2) Q class description, R1.a3,R2.a4 , Cn defined chan Class operation families in (3). The queries are classified in a the Description (Cn) that2a set ofEach different combinationoperation families mustR.an Each different combination of of operation families classes. execu conform text to conforms a class description, i.e. the class Cn defined by this. chang the operation families in (3). The queries are classified in a Figu (3) Cn = { Rn.an , Rm.am , Rn.ap,Rm.aq , R2.a4,R3.a5 } 2) set of classes. text e  composed of all queries that contain at least one operation Figur that (3)class=Cto is composed specified families that contain The Cn {n Rn.an ,ofRm.amby Rn.ap,Rm.aq ,Qn pertains each the , all queries R2.a4,R3.a5 } at least one operation that pertains to each of the specified families as definedisin (4). Thisby all queries Qn Qn pertains The class Cn composed means, a query that contain 17
    • 18. The class Cn is composed by all queries Qn that contain at least one opat least one operation that pertains to each of the specified families as defi 1. Queryfamilies as defined in (4). This means, a query Qn pertains to the class Cn selection C if and only ifpertains operation family familyto the class n operation o2 for all to operation that describes Cthat  Qn, pertains,to operationCnoif andnonlyQnto operation family is of R2.a2 the Cn exists class describes join the an operation o in if for all operation family 3 pertains such as this operationoperation is of the, form nofthe operation family n o4 Cn such pertains F that describes C , exists an operation O in that as this R2.a4,R1.a3 and the join operation . to the operation the form of the operation family F (4) Qand Cn i operation is of family R1.a1,R3.a6 . The operator n ∈ (4) Qnattribute (∀ Rn.an ∈ not) ∃ ((on ∈ Qn ) ∧ determine the the ∈ Cn iff value are Cn important to (on ∈ Rn.an )) Rn.an )) operation family to which a specific operationVille Relation R1 pertains, Q = {O1, O2, O3, O4 } the important knowledge is related to a1 the operation to According numReg According to the query Q presented above, the selection operation o1 Fi type and the attribute(s) included in the a2 SELECT Rest.nom operation. The spec p FROM o1 pertains to operation familyoperationResto, Ville, Region R3.a5 , the nom a3 operation families ‘RA’ WHERE Region.nom = described before make a4 O1 up a class a). vil Any Resto.spec = ‘IT’composed by operations that pertain AND query that is O2 AND Resto.vil = Ville.nom Relation R2 Resto toAND Ville.numDep = Region.numDep pertains to the same !!! b). the families described before O3 a5 class nom O4 a6 num a) C = { R3.a5 , R2.a2 , R2.a4,R1.a3 and R1.a1,R3.a6 b) q ∈ C iff (∀ Rn.an ∈ Cn )∃((on ∈q)∧(on ∈ Rn.an )) 18
    • 19. computational resources consumed by the query and those that are available at the moment that the new query will beny 2. Problem executed as well as in the optimization objective that can changes each time the query is executed.a 2) Problem: A problem is composed by a query, a con- text execution representation, and an optimization objective.  Specifies an optimized query, optimization parameters and measures illustrates to computational resources available of query Figure 6 related the components of a problem. execution  context n  query d  optimizationns targetis∈ Problem Representation (UML Diagram)n Figure 6. Problem representation (UML diagram)e 19
    • 20. available memory, and remaining energy, among others. Finally, the optimization objective indicates the resource or 2. Problem set of resources that will be optimized, e.g. minimize energy consumption. Figure 7 shows an example. Figure 9 Context - representsFigure 7. An example ofcomputational measure of the a problem resources instance sol available when the query is executed which is a The set of touples that represent the instance of context de- projection, Optimization Objectiveis: indicates{ the resource or set of data source picted on Figure 7 - Context = <memory, 400>, <CPU, resources75>, <energy, 70> } . Finally, the optimization objective that will be optimized consumed indicates the resource or resources from which their con- posed quer sumption must be optimized.20 Typically, optimization means { <memory,
    • 21. minimize the utilization of these resources. According to o example, the optimization objective is minimize the memo 3. Case consumption specified by F(memory). 3) Case: A case is composed of a query, a solution (que plan) and a set of evaluation measures used to express t Specifies an optimized query, the solution query. Figure query and t optimization objective of a to solve the 8 illustrates the measures related to computational resources that were components of a case. consumed by the query execution query solution evaluation measures used to express optimization objective Case Representation (UML Diagram) Figure 8. Case representation (UML diagram) 21
    • 22. imization target to a set of measures collected during the query execution.cribed as a set These measures are represented as couples of the form that represents ilable when the 3. Case <attribute, value> and express the computational resources (e.g. memory, CPU, or energy) consumed by the query de CPU charge, execution. Figure 9 shows an example. among others. the resource orminimize energy  Query - optimization target that hasof a case evaluated and solved Figure 9. An example beenm  Solution - physical execution plan that of this model. Such Figure 9 presents a simple instance solves the query instance solves the query Q by means of the query problem which is an ordered and pertinent sequence of selection,  Evaluationprojection, sort, and join collected during query ofce of context de- - set of measures operations for accessing a set execution, 400>, <CPU, data sources. The set of touples representing the resources 22zation objective consumed during the query evaluation applying the pro-
    • 23. are solved. A case is the minimum unit of reasoning. It by tconsists of (i) a problem description, (ii) its correspondent Fsolution, and, (iii) aReasoning Process 4. set of annotations that describe how sentthe solution was derived. Case based reasoning has been theformalized as a four-step process: retrieve, Retrieval review and reuse,retain query class, query plan [7]. Retention * The * Get relevant cases using a similarity function and consumption measures * If there is no relevant case in are stored in form of a case the case base, a new query plan within the case base must be psuedo-randomly Retrieval generated to increase the query optimizer knowledge Retention Reuse Reuse * Adjust the solution of the Review relevant case to the * Execution plan is problem verified Review * The matching processes depends on the cases’ 23 similarity Figure 4. Case-based reasoning process
    • 24. relevant case within the class must be retrieved by means Similarity Function of an intra-class similarity function [10][11]. When the most relevant case is retrieved, a detailed comparison between the clauses of the new query and the relevant query (the query Inter-class Similarity Function included by the relevant case) is carried out. This determines * used to define membership of a query a similarity level between the two queries. These functions are based on the contrast model of similarity proposed by Tversky [12] that allow us to determine Intra-class Similarity Function the similarity between two objects by means * used to retrieve most relevant case of a feature-matching function. Similarity increases as most common features and decreases as most distinctive Uses features [13]. The formalization of the original definition is a feature-matching function Similarity increases as most common features and decreases as expressed as follows [12]: most distinctive features (5) S (a, b) = θf(A ∩ B) - αf(A - B) - βf(B - A) Similarity between a and b, is defined in terms of the 24
    • 25. ion families and as a decreasing function of distinctive families,go- in other words, families that pertain to one query but not theific Inter-class similarity other. The function can be applied to both classes, each oneing defined by a set of operation families, or applied to a query and a class. In this case, it is necessary to determine the  Increasing function of common operation familiesmp- operation families related to the involved operations. The  Decreasing function of distinctive families the formalization of this definition in terms of the similarity  Determine operation and a class is expressedinvolved operations between a query families related to the as follows: (6) S(C1 ,Q) = θ (C1 ∩ Q) - α (C1 -Q) - β (Q-C1 )ase-vantoperation families commonC C1 and Qis defined in terms of  Similarity between to and Q, 1her-features that pertain tocommon to C and Q, C ∩ Q, the  operation families C1 only 1 1  features that pertain to Q only on features that pertain to C1 but no to Q, C1 - Q, and thoseem. that pertain to Q but no to C1 , Q - C1 . The function f ase refers particularly to operation families . According to the ble purpose of our work, these are the features that must be the compared. the 25 For practical purposes, suppose that we know the class
    • 26. ble of the query q and the definition of the classes c1 and c2 . wo purpose of our work, these are the features that must be the compared. tep the ost Inter-class similarity q For practical3 } c = { R.a1 , ∈ R.a2 ,weR.a3,R.a4 } class = {o1 , o2 , o purposes, suppose that know the ans of the{query ,q and the definition }of the classes c1 and c2 . c1 = R.a1 R.a2 , R.a3,R.a4 wo c2 = { R.a1 , R.a2 , x } ost tep the q = {o1 , o2 , o3 } c = { R.a1 , ∈ R.a2 , R.a3,R.a4 }most ery c1From R.a1 ,intersections between the query class c that = { the R.a2 , R.a3,R.a4 } ans describesR.a1 , query, q x } nes c2 = { the R.a2 and the classes c1 and c2 , it ismost possible to state that the query class c is similar to c1 . the Compute for intersections of C with C1 and C2  of ery From the intersections between the query class c that to nes describes the 1 ∩Q)={ and ,the classes c1 and c2 , it is S(c1 ,q) = (C query q R.a1 R.a2 , R.a3,R.a4 }ans possible = state∩Q)={ R.a1 , R.a2 } c is similar to c1 . S(c2 ,q) to (C 2 that the query class as of Query class C is similar to C1  ive to B. Intra-class 1 ∩Q)={ R.a1 , R.a2 , R.a3,R.a4 } S(c1 ,q) = (Csimilarityn is ans S(c2 ,q) = (C2 ∩Q)={ function aims to find the most similar Intra-class similarity R.a1 , R.a2 } as queries with respect to a new query, which is desired totive be Intra-class similarity same class. In this step, all the B. optimized, within then is compared queries are defined exactly to find the most similar Intra-class similarity function26aims by the same operations (operation type and involved attributes), the is desired to queries with respect to a new query, which difference is
    • 27. queries with respect to a new query, which is desired to be optimized, within the same class. In this step, all the Intra-class Similarity compared queries are defined exactly by the same operations (operation type and involved attributes), the difference is he related to the comparison operators, as well as the attribute ain Aims to find the most similar two queries Q and to a is values. Similarity between queries with respect Q2 new query 1 no  All defined as an increasing function ofoperationsoperations compared queries have the same common ve  Comparison operators or attribute values may differ and (identical operations in terms of its type, attributes of operators). The formalization of this definition is as follows:  de Increasing function of common operationsies (7) S (Q1 , Q2 ) = θo(Q1 ∩ Q2 ) - αo(Q1 - Q2 ) - βo(Q1 - Q2 )ity  Operations that are common to Q1 and features that pertain to Q1 but not to Q2 !!"  Find the query that contains the maximum number of operation mappings! 27
    • 28. two main modules, the case-reasoner and the execution planons in common, they differ in the operator generator. The case-base reasoner is in charge of adaptingjoin operation. Also, q1 and q2 have two Query Optimizer Architecture the solutions of similar queries to the new situation. The ex-mmon, they differ in the operator applied by ecution plan generator is in charge of generating new queryn. Finally, q1 and q5 have only one operation plans in a pseudo-aleatory way. The case-base reasoner isording to this analysis, q2 is the most similar the most complex of the two modules but the smartest, on ect to q1 because contains the maximum the other hand, the execution plan generator is simpler and  Reutilizes the solutions related to queries that does not been solvedtion mappings. q5 is the most different query probably faster; however it have apply machine learning cause it contains the minimum number of techniques. Figure 10 illustrates the optimizer architecture.ngs. Generates new has exactly the  On the other hand, q1 solutionsf mappings with q3 and q4 . How can we hese two queries is the most similar to q1 . A.vels Case-based Reasoner level 1. Smart queries indicates which between two Search Engine levant query must be adapted. This adapta-ormed 2. Adapter and Where clauses. just over Select lause, interesting attributes to be projected 3. Execution Managerhe Where clause, comparison operators or ted to the variablesBase Manager the 4. Case can be modified. OnFrom clause can not be changed because theried can not be changed. Table I illustrates arity levels. Here, selectClause is expresed B. Execution Plan Generator se as FC and whereClause as WC.n must be performed for the similarity levels). If the similarity level is (3) the From Figure 10. Optimizer architecturery clauses are equal, the adaptation must 28n the select clause, which means that the
    • 29. Case-based Reasoner Adapts solutions of similar queries to the new situation1. Smart Search Engine • retrieves relevant cases • applies Inter and Intra-class Similarity functions • selects the query that minimizes the optimization parameters2. Adapter • adapts the query plan included in the relevant case to query problem specifications • used to facilitate and minimize the cost of the adaptation process 29
    • 30. Case-based Reasoner3. Execution Engine • tests the new query execution plan created by the adaptation module4. Case Base Manager • allows to retain a new knowledge in form of a case • similarity function is also used 30
    • 31. Execution Plan Generator 31
    • 32. the query execution (e.g. memory, CPU, and energy). three clauses selectClause, fromClause, is thewhereClause. target In this representation, a query and optimization to a set of measures collected d The selectClause be solved. The context is must be pro- a set that must specifies the attributes that described as These measures are represente A. Case-based reasoning jected of couplesresult. The fromClause specifies the data as query of the form <attribute, value> that represents <attribute, value> and express the same attribute(s), i.e. ox = Greater(R.an ,value) and selection operation o2 pertains machine learning approach Case-based reasoning is a to operation family sets that contain the computational resourcesin the query. measure of information requested available when the (e.g. memory, CPU, or energy oy = GreaterOrEqual(R.an , value), select the values that R2.a2 , the join operation o3 process that operationsolve new that proposes a reasoning pertains to aims to family The whereClause specifies the attributes may include CPU charge, query is executed. These set of conditions (for data execution. Figure 9 shows an ex are greater/greater or equal to some specific attribute that problems using the experienceoperation o4 similarpertains R2.a4,R1.a3 , and the join gained when that problems selection and data combination or join) thatenergy, among others. available memory, and remaining must be verified Figure 9. An exam pertains to the relation R. to are solved. A case is theR1.a1,R3.a6 . unit of reasoning. It the operation family minimum The operator and by the Finally, the optimization query result. data to form part of the objective indicates the resource or The attributes that are involved in operations of Q are the attribute (i) a problem description, (ii) its correspondent consists of value are not important to determine the Figure 5 illustrates the model that we propose minimize energy set of resources that will be optimized, e.g. for repre- numReg (a1 ) and nom (a3 ) that pertain to Ville (R1 ) relation, operation family (iii) which of annotations that describe how solution, and, to a set a specific operation pertains, Figure 9 presents a simple in senting a query. In a Figure 7. shows an example. consumption. query, selection and join problem Figure 7 An example of a operations are spec (a2 ) and vil (a4 ) that pertain to Resto ((R2 )) relation and the important was derived. is related to the operation the solution knowledge Case based reasoning has been instance solves the query Q by m the most important and most frequent. nom (a5 ) and num (a6 ) that pertains to (Region R3 ) relation. type and the as a four-step included retrieve, operation. The formalized attribute(s) process: in the reuse, review and which is an ordered and pertin The set of touples that represent the instance of context de- projection, sort, and join opera We propose the concept of operation family in order to operation[7]. retain families described before make up a class a). Similaritycomposed Qbyand Q2 is defined pertain of the between 1 operations that in terms picted on Figure 7 is: Context = {<memory, clauses <CPU, Sim. Level Equivalent clauses Different 400>, data sources. The set of touples group operations that include the same condition applied to Any query that is 4 SC, FC and WC — operations that before pertainsto the same the features that are common to Q1 and class b). 75>, <energy, 70>}.and WC the optimization objective FC Finally, consumed during the query ev the same attributes and for this reason, the same relations. to the families described 3 SC pertain to Q1 but no to Q2 . It is possible to establish a indicates the resource and FC 2 SC or resources from which their con- WC posed query plan are described Two operations ox and oy pertain to the same operation 1 FC SC and WC mapping one to one for each of the operations included in sumption must be optimized. Typically, optimization means {<memory, 420>, <CPU, 65> family if plan is retrieved samecan be(selection to Q. Also it is query they are of the if it type adapted or join) and a) C =Q1 and Q3 R2.a2 , R2.a4,R1.a3 and Theoperator that each in the ubiquitous according to the comparison solution is { R3.a5 , computing environment. R1.a1,R3.a6 0 — SC, FC and WC minimize the utilization of these resources. According to our time, 150>}. involve the to verify if it is possibleof them must pertains to required same attributes (each to accomplish its execution represented by the correspondingnexecution∈plan. )) b) q ∈ of them apply. Q1 and Q2 have twonoperations in common; C iff (∀ Rn.an ∈ Cn )∃((o ∈q)∧(o Rn.an example, the optimization objective is minimize the memory Table I 4) Reasoning process: The r the same data source respectively). available at thefamily is of with the computational resources An operation moment 1) Query: A query associated toapplied by is definedoperation. a problem the join by they differ in the operator consumption specified by F(memory). QUERIES S IMILARITY LEVELS BETWEEN TWO be accomplished given a An exam Figure 9. new p represented as follows:(e.g. memory, CPU, and energy). the query execution three clauses selectClause, fromClause, and in the def- similar A query is the medullar simple analysis, Q3 whereClause. According to this part of knowledge is most 3) Case: A case is composed of a query, a solution (query the four-step case-based reasoni inition selectClause respect tothe1 attributes it contains the pro- The of a problemspecifiescase. because that must be maximum query with and a Q The problem specifies a plan) and a set of evaluation measures used to express the step is based on a similarity fun (1) Case-based reasoning A. R.an = {on | on = condition(R.an ,value)} optimizedas query result. Themappings. jected number of operation fromClause specifies the data query, the optimization parameters, (e.g. memory, Figure 7. An example of a problem optimization objective of a query. Figure 8 illustrates the Figure 9 presents a simple in Case-based reasoning is a machine learning approach instance solves the query Q mosm smart search retrieving the by energy, that For practical measures suppose to computational 4 and q5 sets and contain and purposes, related that qin q , qquery. CPU) the information requested 1 , the 3 , q 2 projected 5. Query case. be actualized according to the new components of a representation (UML diagram) Figure attributes must which of the problem.and pertin query is an ordered The proposes a reasoning R.an is that aims to solvethe that operation family process composed by new resourcespertain Figure specifies execution. The case specifiesquery, as The whereClausefor same class. set ofdefinition of (for data available the query the reasoningconditions each to 4. Case-based The process requirements. If thethat represent the instancethe context and The set of touples similarity level is (2) of From de- problems using on experience gained whenof the problems the with a condition similar form projection, these and join cases, Among sort, relevant operat operations set the optimizedas data combinationpresented thethe following example. Each operation is defined byequal; therefore, theor 400>, a must selection and its operations, is or join) that must be verified well query, the solution to solve in query (query select query clausesis: Context = { <memory, Join), <CPU, picted on Figure 7 are a type (e.g. Select adaptation data sources. Thethe problem is cost function of set of touples condition(R.an ,A value), 2. where an query unit attribute that It are solved. case is the minimum trees of reasoning. Algebraic is an plan), the data to form part of the query result. by and the measures related to computational resources Figure set of attributes, and a specific condition. Selection operation some be performed on70> }Where clause. In a similar way, 75>, <energy, the . Finally, the optimization objective consumed to the adaptation pro is related during the query ev pertains to the relation R and the condition its correspondent consists of (i) a problem description, (ii) denotes the set that wereoconsumed by,value), stepexecution.2It reasoning pro- Figure 5 illustrates the query =that we propose for that 4 shows the the model case-based is clear repre- four o 1 = Equal(a1 Equal(a ,value), is expressed by conditions are the form condition(attrexp, con- operation thecondition ofdifferent butfrom which their same indicates a resource or resources applied over the included in the relevant case to th posed query plan are described of solution, and, (iii) a setoperators: Equal, that describe how all possible comparison of annotations EqualOrLower, 2 the problemquery. In a3 query,querybe retrieved4 ),operationsnew cess. First,isEqual(a cases o selection itselfjointo solve also sentingoa = relevant ,athe must Lower(a , a not only 4 ), 4 = by and because it a are cnstexp), where attrexp represents thecase, the condition and means attributes musttables- For this Typically, optimization (e.g. sumption and be optimized. selection attribute type step consists in verifying the qu { <memory, 420>, <CPU, 65> Lower, GreaterOrEqual, Greater based reasoning has been the solution was derived. Case and Different. All the 3 3 B. Global optimization includes o5 importantthe3. most3 , step,and the = Different(a2 ,value) cnstexp a suitable constant value. Join operation is According to our problem. Then, Figure reusingfrequent. plan circumstances the LowerOrEqual(a execution adjustment between at and Query a the most =optimization objective) and o an equal, different and greater) and/or the constant value, to minimize the utilization of these resources. expressed resource consumption measure time, 150> } . queries are associated to aprocess: operationreuse, review and formalized as a four-step set of retrieve, families. The 4 6 under solutions offered by the relevant case and theto user the the query must be solved, it varies according problem by a condition the the form condition(attrexp.a, adjusted. memory which theof optimization objective is minimize the Finally, example, attribute is compared must be attrexp.b), retaining step, the problem and 4) Reasoning process: The r retain [7]. of a query Q is defined by communication whereClauseoptimization aims to minimize an operations Global requirements. this1 ,representation, a query is the step, the new target requirements must be done. At the reviewing q1In {o o2 , o3 } = optimization where to the similarity level collected adaptation attributes. if a set of measures isrepresent the join of the Select and attrexp.a and attrexp.b (1) an during consumption specified by F(memory). the query execution. be accomplished form of a newp the case base in given a new set. These operations are members of differentand a set of cost related to interactions among resources operation solution must be verified in the real world (or simulation). Where measures are be done. 3) clauses must families: (e.g. global R2.a2 and ubiquitous computational en- views view). In R1.a3,R2.a4 . Equation (2) not available{othepiece4of knowledge thatquery described as a set TheThese Case: A case is composed of asquery, a solution (query The query=is the o2 , o } that must, be solved. The contextlinks optimization q2 Finally, after[4] [5]. Moreover, classical 1 is a problem solution has been successfully adapted condition expressesrepresented a couples of the form a comparison (e.g. equal, the1) Retrieval. Relevantreasoni four-step case-based cases R1.a1 , with the of3 couples o3 ,generate query execution plansthat represents techniques= {o1cases,the and pertinently contain a the new q typically oi.e., the cases that value> query existent , of 2 } form <attribute, that are different, lower, avalue> evaluation measures used to express the plan) and set of and between the data values of <attribute, greater, etc.)express the computational resources step isilarity function applied d based on a similarity fun shows the operationis not a global view due to its expensive vironments there families Q that are associated to each to the target problem verified, operations in Q. constant changes in the environment. The maintenance and optimized =query othestoredin the problem can be execution the table attrexp VI. objectiveOPTIMIZER ARCHITECTURE query similar toqtheaccording, to5 a single dimension, queryuseful to 4 {o , 2 ocomputational resources available when a measure 1of included experience must be } as a new case in memory; this (e.g. memory,QCPU, or energy) consumedattribute. the optimization a UERY of value or another 8 by the and constant a query. Figure illustrates smart order to know which most search retrieving the quer global optimizer divides the execution tree that was produced time [6].5 = {oexecuted. These attributes may include CPU a qnew is 1 , o , o4 } is accomplished in the retaining step. In order to propose components of a case. id, its name, and solve thequery query;6however this is the only characteristic charge, attribute is defined 8.9 shows an example. the table to An execution. Figureby Case representation (UML diagram) Figure an In order to solve a query, we propose a query optimizer query solve the new problem (q of the problem. of interest for us.tomemory,necessary toabsence; useful knowl-others. It is available onis also and remaining attention on the energy, among needed It deal with metadata pay work adapts case which it corresponds. The following example allows us to Among context measures). G by the logical optimizer , (2) Q = { R1.a1 , R2.a2 and decides ,the place to }perfor strategy based machine learning, this that provides two alternatives. The first one reutilizes the and these relevant cases, R1.a3,R2.a4 R2.a4,R3.a5 each part . The new execution tree includes communication edge must bepossible consumed by mapping isandtheone Finally, the optimization objective indicates queries computationalisresources to from previouslyqueryone tothose for each It obtained establish a the executed appro- based reasoning to query optimization, which also resource or appreciate the case, a query representation of a optimization target In a whereClause corresponds to an query Q as cost function of the similar alre containing a problem is that arebe managed the moment thatoptimized,queryaccording energyset of its selection and join operations. been solved; the second and available at andthatthe lack of metadataqcharacterized to the set of resources exploited by qmeans e.g. minimize will be the new of the operations included in 1 and of automatic 3 will be a solutions related to queries that have is related to the adaptation pro operators e.g. work of activities performed for a set of priate when dealing with that has been evaluated and solved. The solution corre- one generates new solutions. The optimizer is composed by retrieved. If there is no releed during supportEach affirmation, we describe the classicalfamilies R.an this different combination of operation query op- resources. executedconsumption. Figure that each an objective that1 can q2 have learningas wellenvironments. showsimprove or acquireand comparison operator 7 is to of them apply. q new as in the optimization example. techniques. The goal by ubiquitous sponds to the physical execution plan that solves the query; included in query plan must be th new the relevant case to (p two main modules, the case-reasoner and the execution plan ere is no timization process. In distributed i.e. the class C defined conforms a classa description, environment, thisnprocess by changes eachtwo operations in related to some differ in tasks. just time the query is executed. capabilities from5.experience common, they specific the operator Query 1 step consists in verifying the qu generator. a tree where nodes represent charge of adapting typically, The case-base reasoner is in algorithms (imple- to be able to increase the is composed by three phases: (3). The global, and classified in a the operation families in logical, queries are physical. C. Physical optimization applied problem representation (UML a q in q2 have Figure Query diagram) We Problem:anby the joinadaptation to query 1optimization two B. Case-based reasoning is operation. Also, query, a ubiqui- 2) propose A approach for query optimizationand con- composed by resource consumption measures set of classes. optimization phases are related to the solutionsof similar operators) the new situation. The data mentations FROM Resto,Ville,Region and links represent ex- SELECT Rest.nom of query queries to 2) Reuse. It is possible to reu sical lim- Logical and physicalFigure 4. Case-based reasoning process cen- Physical optimization techniques aim to reduce disk ac- text execution representation, and an differmachineobjective. in tous computing query optimization optimizationoperator case We operations in common, they strategy the adapts applied by propose environments based on in that learning retaining step, the problem and WHERE Region.nom=’RA’ ANDis Finally, the evaluation corresponds flows among operators. in charge of AND ecution plan generator Resto.spec=’It’ generating new query means of their adaptation ation, e.g. tralized environments. Global optimization iswell as toin a cess for retrieving requested dataplan required minimize as Figure 6 reasoning theorder Finally, qofandproblem. ofor Join), a Eachillustrates inis problemby a type (e.g. have only one operation based address components 1 to q5 execution plans the join operation. to related a lacking order to operationthedefined provide optimalSelect metadata Resto.vil=Ville.nompseudo-aleatory way. The case-base reasoner is plans in a AND Ville.numDep=Region.numDep the case base in form of a new consump- distributedCn = {4Figure for the four step case-based reasoning pro- (3) environment.3., Rm.am , Rn.ap,Rm.aq , R2.a4,R3.a5 Query execution execution time Figure 1 illustrates the optimization } An Figure shows evaluating query execution plans. Rn.an [3]. solve common. According to this analysis, q2 is adapts thesimilar to of attributes,the queryThis condition. Selection the most in new and a specific strategy recovers, operation set Moreover, queries. evaluation time is no longer or the most complex of the two modules but the smartest, on !!" 1) Retrieval. Relevant cases process is munication phases execution plan optimizationmust be retrievedimplementaeach cess. First, relevant cases process. that to solve new of the typical is formed by algorithms is expressed with objective using because contains acquired query by a condition q the knowledge the maximum The query Q includes two selection operations Re- main optimization respect toin 1 the form condition(attrexp, generates execution plans of ubiquitous computing envi- the other hand, the execution plan generator is simpler and ilarity function applied dindwith the a set of operator Then, at the reusing all queries implementations The classof n is composed tree. Different Qn that contain C problem. the algebraic by step, an adjustment between ronments,experience to optimizetools execute similardifferent query from the where attrexp represents theandiselectronic devices cnstexp), where computational and q5 the most queries number of operation mappings. selection attribute and gion.nom=RA (o1 ) and Resto.spec =not apply ), as well probably faster; however it does ’It’ (o2 machine learning order to know which queri onvenient ational en- not at for each[4]operationoperator have toquery optimization an available algebraic that pertains beencaseof thethe problem least one [5]. Moreover, classical each the solutions offered by the relevant proposed. Given and specified have physical limitations (e.g.itenergy), in additionexpressed [8]. respect to q1 because contains the minimum number as two join operations Case representation (UML diagram) and cnstexp a suitable constant value. Join operation is they are of techniques.Figure 8. 10 Resto.vil=Ville.nom (o3 )architecture. Figure illustrates the optimizer solve the new problem (qu n expensive specific techniques typicallymust be done. At the reviewingQn pertains families as defined in optimization phase query thatall corre- generate query means, a produces are new algebraic tree, this (4). This execution plans byAccording to thisthe form athe other hand, q1tohas exactly the operation mappings. On case corresponds the rep- distributed, dynamic,approach,condition(attrexp.a, proposes a a condition of and autonomous. Our work attrexp.b), Ville.numDep=Region.numDep (o4 ). They of a case the Equal Figure 9. An example apply requirements step, the and context measures). Ginment. The tosponding Cn if and onlydimension, operation family the according to a single if for all query execution optimized classexecution plans that the real the implementation of solution must be verified in specify world (or simulation). query optimizationknowledge that allowsthe join experiences we resentation of the technique acquired from and attributes. can conditionIn a case, a query corresponds to an optimization target where same number attrexp.b represent q3 the q4 . How attrexp.a and of mappings with the user customize that express the comparison operator of equality. containing a similar alrea ics previ- s produced time [6]. algebraicnthe solution calculate n successfully as thisof each Finally, after , exists an operation o the execution time that describes C operator. To has been in Qn such adapted theTheknow which optimization and to his the most similar to qThe operation set presents to simple denoted by Qssolution, corre- obtainedcondition of these two queries is requirements. optimization objective according evaluation (e.g. equal, from the expresses a comparison of previous 1. that has 9 related a Q and instance of this = {o1 Such Figure been evaluated is solved. The model. retrieved. If there is no releeition perfor to and It isto the isto dealand to ofand operation family knowl- new operation of the with metadata absence; useful . metadata form the neededtarget problemminimize the disk verified, the different, problem corresponds example of a problem Figure 7. An queries. Alower, greater, etc.) between thequery submitted data values of each algorithm pertinently access, C. Q UERY OPTIMIZATION to a new LERNING IV. Similarity levels o2 , o3instanceto possible query Q by means that solves the query; spondsis solves the to apply different of the query to }. It the physical execution plan conditions problem new query plan must be (pdmunication statistics edge relatedbe obtained from previously executed memory; this must to execution context as required, e.g. the algorithms a table attrexp and a constant value orON BASED another attribute. experience must be stored is a new case in queries which is an tree where nodes represent algorithms (imple- typically, a ordered and pertinent sequence of selection, to be able to increase the q al schema and (4) Qn ∈ Cna iff (∀inexploited∈ byn )meansn of join,)to propose a be perform join operation are nested-loop Qn merge join, to accomplished the retaining step. In ∈ automatic ∈ An attribute setdefined thisthatid, its name,queriesfrom context de- The similarity level between two The general ideatouples an represent the learnthe table to The is of of by approach is to and indicates which r a set of is managed and Rn.an C ∃ ((o order ∧ (on instance of past projection, sort,queryjoin operations for accessing a set of mentations of and operators) and links represent data 2) Reuse. It is possible to reu s mainte- learning techniques. Themachineto improvethis acquire new case and hash based on goal is learning, or work adapts Rn.an )) which picted on experience is query must be adapted.from a !!" clauses of the relevant experiences. An Figure The following=example allows us to it corresponds. 7 is: Context {<memory, 400>, <CPU, the knowledge gained This adapta- strategy join. tion the whereClause representation of a query Q as can be performed just over Select and Where clauses. data sources. The set of Finally, the evaluation corresponds flows among operators. touples representing the resources means of their adaptation t changes capabilities from providesquery optimization, which is tasks.appro- appreciate <energy, 70>}. Finally, as optimization of based reasoning to an related to of a query execution plan Figure 3 experience example some specific also problem resolution. Learning is defined the the acquisition objective 75>, consumed during the query evaluation applying the pro- We propose whento theto the algebraic treemetadata ubiqui- in Accordingapproach for querylack of above,in characterized a set of itsthe Selectto improve resources from toto be projected For selection clause, interesting attributes indicates the and join operations. priate an dealing with the optimization the selection that corresponds query Q presented that was produced knowledge in order resource or the(UML diagram) which their con- can vary. Problem representation behavior or acquire Figure 6. For the Where clause, comparison operators or posed query plan are described as follows: Evaluation = ce diskac- adata ac- tous computing 1environments based on machine learning in the operation o pertains to operation family the local optimization phase. by ubiquitous environments. R3.a5 , new capabilities must be optimized. Typically, optimization means sumption from previous experiences. Within compu- {<memory, 420>, <CPU, 65>, <energy, 8>, <execution !!"Ubiquitouso minimize order to address the problem related to lacking of metadata Query minimize the subdiscipline concerned with learningOn the some values related to the variables can be modified. tational1domain, the utilization of these resources. According to our other hand, the From clause can not be changed because the time, 150>}. ethods to plans. An [3]. Moreover,U BIQUITOUS COMPUTING IMPACT INoptimization III. the query evaluation time to query QUERY B. Case-based reasoning adaptation is no longer the is called machine learning [5]. Itobjective is minimize the memory example, the optimization is an artificial intelligence 4) Reasoning process: The reasoning process that must main optimization objectiveOPTIMIZATION computing adapts case !!! tables to be queried can not be changed. Table I illustrates SELECT Rest.nom FROM Resto,Ville,Region e proper- ement each We propose query optimization strategy that envi- in ubiquitous consumption specified by F(memory). subdiscipline in charge of designing and developing methods WHERE Region.nom=’RA’ AND Resto.spec=’It’ AND be accomplished given a new problem is an adaptation of ronments, where computationalto provide electronicquery evalua- the diverse similarity levels. Here, selectClause is expresedvironment mentations Query optimization is tools and improve devices based reasoning in order essential to optimal execution plans that allow computers to is composed of a query, a order to (query Resto.vil=Ville.nom A case as FC and whereClause as WC. 3) Case: AND Ville.numDep=Region.numDep automatically learn in solution the four-step case-based reasoning process. The recovering as SC, fromClause .Some of Given an have tion.solvelimitations (e.g. This strategy recovers, adapts or physical newquery optimization techniques are notare to Classical queries. energy), in addition they capable improve or create set of evaluation measures used different the plan) and a specific capabilities. There are to express step is based on a similarity function in order to perform a Figure 1. Phases of the optimization process The adaptation must be performed for the similarity levelsestimatings all corre- distributed, dynamic, challenges that ubiquitous environment char- to deal withexecutionautonomous. Our work proposes a generates the and plans using the knowledge acquired automatic learning includes two aselectionFigure interested the Theoptimization methods, from which, we are 8 illustrates query Q objective of query. operations Re- smart search retrieving the most relevant cases to solve the (3), (2) and (1). If the similarity level is (3) the From execution entation of queryacteristicsexperience to optimize and execute similar queries from the imply. We arethat allows the user customize opti- optimization technique particularity interested in the in case-base reasoninga [7].Resto.spec = ’It’ (o2 ), as well components of case. gion.nom=RA (o1 ) and and Where query clauses are equal, the adaptation must query of the problem.10. Optimizer architecture Figure on timeof result of the optimization objective according toof metadata and has Each phase require different metadata requirements. mization problems related to lack his types and optimiza- [8]. asIn two approach, the knowledge gained from an experience our join operations Resto.vil=Ville.nom (o3 ) and Among these relevant cases, the one that minimizes the
    • 33. modules, one that reasonablerepair does not include redundant and useless is allows to if it incorrect statistics and cardinality, also mprise it are estimates a query executionwaste of computational resources. operations that represent a plan[14]. ution engine Optimizers repair incorrect statistics and Server alsobased The construction of reasonable execution plans is use that allows tobased on plan caching i.e. SQLcardinality, also on a set of rules that define the physical SQL Server stores machine learning techniques. plan[14]. operator (algorithm s with a case estimates a query execution Particularly,dge acquired execution plans and data buffers. Nevertheless, itapplyingthe based on the iterator model) pertinent for extends the Optimizers based on plan caching i.e. SQL Server also use execution of each operation. The set of rules implements general query optimizer architecture and is SQL Server stores d). machine learning techniques. Particularly, based on classical he first step query optimization heuristics (selections and projections tied classical algebraic first) execution plans and techniques, e.g. it is still narrowly the data buffers. Nevertheless, it extends This module up to identifies reasonable choices that have to be randomly and the use of metadata[15]. general query optimizer architecture and is based on classical rity function done (e.g. join execution order or reasonable algorithms). query optimization techniques, e.g. it is still narrowly tied) in order to These rules are applied in each level of the execution plan VIII. F IRST EXPERIMENTS up to the use of metadata[15]. r query with every time that an operator is added to the tree. This section presents the first experimental results ofAdditionally, VIII. F IRST is twofold: our prototype. The objectiveEXPERIMENTS(i) observe theases the one Figure 14. Evaluation time results (c) threshold = 30 behavior sectioncase-based the first experimental results of This of the presents reasoning optimizer and (ii) study (e.g. energy the variations onThe objective is and memory consumption our prototype. evaluation time twofold: (i) observe the when theofcase-base is preloaded with different (ii) study Figure 14. Evaluation time results (c) threshold = 30 uded in the behavior the case-based reasoning optimizer and amounts of knowledge. on evaluation time and memory under which the variations This knowledge is a threshold consumption to the query Each figure is composed of 100 rounds of query eval- execution plans are systematically generated instead of ex- when the case-base is preloaded with different amounts most conve- uations where queries are taken from five different query tracted from theThis knowledge experiment thatunder which of knowledge. case base. The is a threshold we propose e cost of the classes. The executed query is of 100 rounds of query eval- ilarity levels consists in plans are systematically generated instead of ex- execution executing a set of queries related to five different Each figure is composed randomly selected. The X axis query classesthe case base. Thethe measures relatedpropose represents each queries The taken from five different query uations where round. are Y axis represent the consumed nd the query tracted from and registrating experiment that we to the computational resources that queriesconsumed five different ocmputational resources. is randomly selected. The X axis consists in executing a set of were related to during their classes. The executed query Figure 15. Memory consumption results (a) threshold = 10 Figure 17. Memory consumption results (c) threshold = 30 execution. query classes and registrating the measures related to the represents 12, 13 and 14 show therepresent the consumed Figures each round. The Y axis query evaluation time ry executionen executing computational Reasonable (a) and were consumed during their Figure 11. resources that unreasonable (b) execution plans ocmputational thresholds. Here, the results (a) threshold = 10 Figure resources. w.r.t. different15. Memory consumptionoptimization objective is Figure 17. Memory consumption results (c) threshold = 30 rator: select, execution. minimizing12, 13 and 14 show the Something we observe Figures the total evaluation time. query evaluation time s based on An execution plan is reasonable if it does not include is that this evolution is decomposed in two phases: (i) is w.r.t. different thresholds. Here, the optimization objective ao take some redundant and useless operations that represent a waste of learning phase whereevaluation time. Somethingcahotic; (ii) minimizing the total evaluation time est very we observew query plan. computational resources. Figure 11.a illustrates an unrea- a stabilized phase where decomposed in two reuse known is that this evolution is the query optimizer phases: (i) a the memory sonable execution plan. Figure 11.b illustrates a reasonable query plans andwhere evaluation time est very cahotic; (ii) learning phase updates the execution measures. execution plan. a stabilized phase where the query optimizer reuse lead to We can also observe that low values of threshold known The input data of the plan (a) is a sorted relation R poor performanceupdates the execution measures. (Figure query plans and stability and longer learning phasee carries out according to the attribute a, as a first step, the relation is 12 We canhighest valuesthat low learning phase but do not while also observe reduce values of threshold lead toto retain the sorted according to the attribute b in order to improve the improve stability stability and longer learning phase (Figure poor performance (comparing threshold of 20 and 30 onnew case we execution of the next selection operation. Then, the result is figures 13 highest values gain in evaluation time buta do not 12 while and 14). The reduce learning phase is factor or if a new sorted again according to attribute a, finally a join operation from two stability (comparing threshold of 20 and 30 on improve to five.n is also here is carried out with another relation S. Figure 12. Evaluation time results (a) threshold = 10 figures 13 15,16.14). The gain inmemory consumption factor Figures and16, Memory consumption results (b)time is a= mea- Figure and 17 show evaluation threshold 20o classes. To Plan (b) is the most simple, first step performs the Figure 18. Resource consumption results from two to the same experimental conditions, except opti- sures under five.e new query selection and then the join operation that take advantage mization objective Memory minimizingresultsconsumption 20 Figure 16. that consumption memory consumption. Figures 15, 16, and is show memory 17 (b) threshold = mea- Figure 18. Resource consumption resultsnd compared of the ordering of the relation results (a) threshold attribute a. It Figure 12. Evaluation time R according to = 10 In a similar way to the first series of experiments,except opti- sures underI the sameCexperimental D F U T U R E W we K observeimilar to one is evident that the first plan consumes more computational X . C O N L U SI O N S A N conditions, O R we propose a pseudo-random query plan generator able to that the memory consumption is divided in consumption. mization objective that is minimizing memory two phases: of the class. resources than the second one, i.e. disk space, memory evaluate queries even if there is no corresponding case in chaotic initial learning phase, andexperiments,exploitation In a similar IX. C ONCLUSIONS AND stabilized WORK We propose a new query of FUTURE technique that way to the first series optimization we observe we propose a pseudo-random query plan generator able toase-base and and cpu for each sort operation. An execution plan must the case base. phase. One case-based reasoningisindivided tolow threshold that the memory point is that exploits major consumption with order in improve query a vert two phases: evaluate queries are working in is prototype that implementshe new class. be selected in an aleatory way. The selection is performed value, thepropose ubiquitous environments. Our techniquedeals Currently we even if there a no corresponding case in over a set of reasonable execution plans; this is why the optimization in optimization is optimization factor (figure We initial learning phase, and stabilized approach that chaotic gained a new query only a two exploitation the case base. order to perform an experimental evaluation our solution in 15) while wemajor point is four with order tolow threshold exploits case-basedthat the lackin metadata improve in this with the obtain a reasoning of a vert implies query phase. Onechallenge factor that with greater values (figures mechanism that we propose is not totally aleatory. 16 optimization in againWethreshold only aistwo factor (figure of Currently we are working in a prototype that implements our approach. It is very interesting to apply this solution to not enough) executionOnce ubiquitous environments. Our approach deals value, the gained optimization is of 30 not clearly is based and 17). context. a propose a technique that better our solution in order domains whereexperimental evaluation different application to perform an possible solutions canfore a totally VII. R ELATED WORK thanwhile useful of 20. the lack of metadata implies in this withthreshold knowledge (resource consumption measures) on the challenge that 15) athe we obtain a factor four with greater values (figures of our approach. performance criteria to apply this solution to execution from previous propose a technique that is based be enumerated, It is very interesting are known, but where e propose a obtained context. Wethreshold of of is not In addition, Related work use machine learning techniques in order 16This 17). Onceshows athe query executions. computationalwe and graphic again average 30 the clearly better different application domains where possible solutions can important information is not available when deciding the of execution to address the query optimization results (a) threshold = 10they resources useful knowledge (resourcethe configuration 30thethe Figure 15. Memory consumption problem. However, on the a technique propose consumed during allows results (c) thresholdmeasures) Figure 17. Memory consumption consumption than a threshold of 20. that the experiments. It reflex of = be enumerated, performance criteriaFor example, but where best solution (statistics in our case). are known, automatic Figure 15. on metadata. Moreover, they perform10 Memory consumption results (a) threshold = some obtained from previous query executions.threshold = 30 we Figure 17. Memory according to the usersIn addition, consumption results (c)ast to typical are still based reduction of theobjective the average of the computational optimization consumed computational resources application This graphic shows and as more important information is not available when a declarative service composition generated on demand via deciding the not include special treatment over metadata in order to improve the knowledge within in the that allowsThis experimental eval-the propose a technique each single the configuration of requirements, even for case base. query. best solution (statistics intarget. Dynamicity management is language seems a good our case). For example, automatic resources consumed during the experiments. and application optimizationimportant contributions theour work reflex the Itucts directly optimization calculus, e.g. the LEarning Optimizer LEO, uation will be improved according to of users The most objective by dynamically are centered service composition generated on on. However, the system also an important point to work demand via a declarative Figure 13. Evaluation time results (b) threshold = 20 reduction of the consumed computational varying other pa- resources as more requirements, even for each single query. re-adaptation of in the reasoning steps related to retrieval and rameters, such as number of query families, database volume language seems to good target. Dynamicity management no should be able a detect those cases in its case base isinality, also knowledge within in the contributions of our work are centered The most important case base. This experimental eval- !!" and evaluation rounds. These steps retrieve the most relevant the useful knowledge. uation will be improved by dynamically varying other pa- of also anrelevant andpoint to work on. However, problem of longer important thus delete them. This is a the system Figure 13. Evaluation time results (b) threshold = 20 in the and adapt a previous solution to the new situation. We cases reasoning steps related to retrieval and re-adaptation should be able to detect those also working case base no rameters, such as numberThese steps retrieve the most relevant of query families, database volume the useful model to represent a query, a problem and a case. knowledge refreshment. We are cases in its on improvingver also use propose a knowledge. longer relevant and thus delete them. This is afor example the knowledge acquisition and exploitation, problem of erver stores !!" and evaluation rounds. cases and adapt a previous solution to the new situation. We Moreover we define a similarity function to determine which knowledge refreshment.between also workingnetwork or by by sharing case bases We are nodes in a on improving extends the propose a model to represent a query, a problem and similar query, related to cases stored in the case base, is a case. the knowledge acquisition and exploitation, for example Moreover we define a similarity function to determine which reducing the granularity of cases to handle sub queries on classical and useful to optimize a new one, which is the problem by sharingfull queries. between nodes in a network or by !!" query, solved. to cases stored in the case base, is similar instead of case bases rrowly tied to be related The adaptation depends on the similarity reducing the granularity of cases to handle sub queries and useful to optimize betweenone, two queries. Basically, level that is determined a new the which is the problem instead of full queries. R E F E R E N C E S to be solved. process consists in evaluating the operations the adaptation The adaptation depends on the similarity [1] E. Bardram, “Activity-based computing: support for mobility level that is determined between the two queries. Basically, of the query with variations in their conditions. Finally, R EFERENCES and collaboration in ubiquitous computing,” Personal Ubiq- Figure 16. Memory consumption results (b) threshold = 20 the adaptation process consists in evaluating the operations [1] E. Bardram, “Activity-based computing: support for mobility results of Figure 16. Memory consumption results (b) threshold = 20 of the query with18. Resource consumption results Figure variations consumption results Figure 18. Resource in their conditions. Finally, and collaboration in ubiquitous computing,” Personal Ubiq-