Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Framework for Query Optimization

Framework for Query Optimization

Ratings: (0)|Views: 206|Likes:
Published by ijcsis
Modern database systems use a query optimizer to identify the most efficient strategy, called “plan”, to execute declarative SQL queries. Optimization is much more than transformations and query equivalence. The infrastructure for optimization is significant. Designing effective and correct SQL transformations is hard. Optimization is a mandatory exercise since the difference between the cost of the best plan and a random choice could be in orders of magnitude. The role of query optimizers is especially critical for the decision-support queries featured in data warehousing and data mining applications. This paper presented an abstraction of the architecture of a query optimizer and focused on the techniques currently used by most commercial systems for its various modules. In addition, provide technical constraint of advanced issues in query optimization.
Modern database systems use a query optimizer to identify the most efficient strategy, called “plan”, to execute declarative SQL queries. Optimization is much more than transformations and query equivalence. The infrastructure for optimization is significant. Designing effective and correct SQL transformations is hard. Optimization is a mandatory exercise since the difference between the cost of the best plan and a random choice could be in orders of magnitude. The role of query optimizers is especially critical for the decision-support queries featured in data warehousing and data mining applications. This paper presented an abstraction of the architecture of a query optimizer and focused on the techniques currently used by most commercial systems for its various modules. In addition, provide technical constraint of advanced issues in query optimization.

More info:

Published by: ijcsis on Nov 25, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/12/2013

pdf

text

original

 
CompuPatel colpa
 ABSTR
Modern datthe mostdeclarativetransformatifor optimizcorrect SQmandatorythe best plmagnitude.critical forwarehousinpresentedoptimizer amost comaaddition,in query opt
Keywor
Query opti optimizatio
1.
 
Intr
For significproductivitsuccess in tavailabilitylow-level ddata, relatiocomplex qparticular, tnot exactlydesignedprocessor.tedious tasprocessor.effective trdata invol2]. Scientifirequests usDBMS. Thhigh perfortime on loare specifieimplemente 
F
Pawan MeeDepartmentter Science andlege of scienceBhopal,M.P,INanmeena75@y
CT
 abase systemsfficient strateSQL queries.ions and queryation is signifi
 
L transformatixercise since thn and a randoThe role of the decision-sand data min abstractiond focused on tercial systemrovide technicimization.
s
 
izer ,Operato 
duction
antly improve a, relationalhe treatment of of non-procedetails about thnal database laueries in a co build the ansspecify the proy a DBMShis relieves thk that is manodern databaatment of larging the applicc analysis caer-defined funcquery optimiance without t-level programand easily chad as filters, can
ramew
aof Engineering
 
& TechnologyDIAhoo.com
 
se a query optiy, called “plaptimization isequivalence. Ticant. Designinns is hard. Oe difference betchoice coulduery optimizepport queriesining applicatiof the architecthe techniques cfor its variol constraint of 
 tree, Query
pplication develatabase techndata is appropriural languages.e physical orgguages allow tncise and siwer to the queredure. This promodule, knuser to queryaged correctlyes can providamounts of coation of specibe specifiedtions (UDFs) iation provideshe need for reseming. Moreovenged, new theorbe tested quickl
ork for
ComputePatel colleBArunizer to identif n”, to executuch more thane infrastructureffective andtimization isween the cost obe in orders o
 
rs is especialleatured in datns. This papeure of a querurrently used bs modules. Inadvanced issue
 nalyzer, Quer
pment and useology growinate in part to thBy hiding thnization of the expression ople fashion. In, the user doecedure is in facwn as queroptimization,by the quertools for thmplex scientifific analysis [1as high-leveln an extensiblscalability andarchers to spend, as the querieies, for exampl.
Query
Arun JhapateDepartment of r Science and Ee of science &hopal,M.P,IND_jhapate@yaho rrt,lQueriare cof queraggrecompquerapplyqueriand squeri• The• TheThaggre• The• Thediffic• The 
optimi
gineering
 
TechnologyIA.comies about evenmplex with maeach eventinvolving selecgates, UDF,lex derived eveis to look for eing scientific ts need tocalable. Howevs is a challengequeries containsize of the quercut definitiongates.filters definingre are dependenult to find or mUDFs cause deFigu
zation
ParDepComputer SciPatel college of BhopaParmalik ts are compleny predicates a. The cotions, aritand joins. Thent properties. F
 
vent productioneories expressebe optimizedr, the obecause:many joins.ies makes optimcontain manythe cuts use macies between edel.pendencies betre 1: Query Opti alik kumarartment of nce and Enginescience & Techl,M.P,INDIA83@gmail.comx, because theplied to the pronditions of metic opaggregates cr example, a cHiggs bosons [1cuts. These cfor the etimization of cization slow.more or less cy numerical Uent properties teen query variaimizerering
 
nologycutspertiestherators,mputemplex, 3] bymplexfficientmplexmplexFs.hat arebles.
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 10, October 2011102http://sites.google.com/site/ijcsis/ISSN 1947-5500
 
 Relational query languages provide a highlevel "declarative" interface to access data storedin relational databases. Over time, SQL [1,4] has emergedas the standard for relational query languages. Two keyelements of the component of the evaluation of a systemfor querying SQL databases are the query optimizer andexecution engine queries. The query execution engineimplements a set of physical operators. An operator takesas input one or more data streams and producesan output data stream. Examples of operators are physical(external) sorting, sequential analysis, index analysis,nested loop join and sort-merge join. We refer to operatorssuch as physical operators since they are notnecessarily related one by one with the relational operators.The easiest way to think of physical operators is like piecesof code that are used as building blocks to enable theexecution of SQL queries. An abstract representation of such a performance is a physical operator tree, as shown inFigure 2. The edges in an operator tree represent theflow of data between the physical operators.We use the terms physical operator tree and executionplan (or simply plan) interchangeably. The executionengine is responsible for implementing the plan resultinggenerate responses to the request. Therefore, theCapabilities of the query execution engine to determinethe structure of the operator trees that arepracticable. We refer the reader to [5] for an overview of the technical evaluation of the query. The queryoptimizer is responsible for producing the input for theexecution engine. It takes a parsed representation of anSQL query as input and is responsible forproducing an efficient execution plan for the given SQLquery in the space of possible execution plans. The task of an optimizer is nontrivial since for a given SQL query,there may be many operator trees possible:• The algebraic representation of the data query can betransformed into many other logically equivalent algebraicrepresentations: for example,Join (Join (P, Q), R) = Join (Join (Q, R), P)• For a given algebra representation, there can be manyoperator trees that the operator algebraic expression toperform, for example, in general, there areseveral algorithms supported them in a system database. Inaddition, the current or the response time for theimplementation of these plans is verydifferent. Therefore, a choice of execution by theoptimization program is crucial. For instance, queryoptimizations are regarded as difficult search. To solve thisproblem, we need:• A space of plans (search space).• A cost estimation technique so that a cost may beassigned to each plan in the search space. Intuitively, this isan estimation of the resources needed for the execution of the plan.• An enumeration algorithm that can search through theexecution space A desirable optimizer is one wherethe search space includes plans to lower costs, the costingtechnique is correct and the enumeration algorithm eff-icient. Each of these tasks is nontrivial and that iswhy building a good optimizer is a huge undertaking.
Query AnalyzerQuery OptimizerCode Generator/InterpreterQuery Processor
Figure 3: Query traverses through DBMS
Index Nested Loop(P,z=R,z)Merge_Join(Pz=Qz)Index Scan RMerge_Join(Pz=Qz)Merge_Join(Pz=Qz)Table Scan
 
P
 
Table Scan
 
Q
 
Figure 2: Physical Operator Tree
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 10, October 2011103http://sites.google.com/site/ijcsis/ISSN 1947-5500
 
The path treaction isallowing it tThe Querycreates an irelationalquery optimequivalentestimatedor interpretoptimizer c 
2.
 
Que
In this secoptimizatioquery on iemployedalternativesbest estimatprocess of shown inarchitecturean optimizemodules shas in Figuoptimizatiorewriting anfirst stage,the secondin Figure 4 i F
Revise:
Tquery andmore effectiwith theirprocessingthat is, statihrough a queryhown in Figuro move the follnalyzer check ternal form,calculus oizer considersto the given qto be less er changeslls the query pr
y Optimiz
tion, we providprocess in at, several execto answer theneed to be coned
 
performancegenerating anFigure 4, whof a query optir based on thiswn do not alwre 4. Based o
 
process cand planning [6].the Rewriter, wstage. The funcis analyzed beloigure 4: Queryhis module appproduces similive, for exadefinition, tois done by thec the characterito a DBMS is3.The modulewing functionsthe validityusually an expr somethingll algebraic expuery and choo
 
xpensive. Thethe map generocessor.
tion Archit
e an abstractioBMS. Given aution plans exquery. In prisidered so that tis chosen. An atesting theseich is essentiizer. Althougharchitecture, inys have so clean Figure 4, tbe seen as havThere is only ohereas all othertionality of eachwptimizer architlies transformatir questions thatple, replacemettend nested qauthor only ontics of requestsgenerated by its of the system.f the query; iression of thsimilar. Thressions that arse one that icode generatoted by th
ecture
n of the querdatabase andist that can binciple, all thhe one with thbstraction of thalternatives illy a modulaone could buildeal systems, thr-cut boundariee entire quering two stagese module in thmodules are inof the modulectureons to a givenare hopefullt of thougheries, etc. Ththe declarativeand do not tak  ,tr
 
r:t,intoDBMor asotherof thin de
Sch
stagequerthe bgenerstrateparticof thstructthe cbe asthe pltheirchoseof thSize
Stat
execfor ethe sTheyformof thPlannoper
Stru
of peactiorelatenestdataelimiof ththe Drelatieachformprodwhicoper
Cos
formplansindexstepformof tapprbasedaccount the acS and the datasumed always pwise sent totransformationlarative level [
mer:
This i. Examine allgenerated inst global marate the origigy that examinular fashion. Toptimizer,ure. Most of thst, i.e., work tilow as possiblelans reviewed bcost estimatesn. These costsoptimizer,llocation.
 
istical Spac
tion orders thach query sent tme query ansare usuallylas or in tree f e objects generer, the overallting at the proc
ctural Spac
rformance thats ordered by thd to the join md loop, scan anstructures are bated, and the cis kind, whichBMS. This chonship, which idatabase storedla or tree froces all corresspecify thetor and the use
Model:
Thlas that are use. For every dif type access, anthat can be fola that gives itese steps, mximations of on certain asstual cost forase in questionositive, the initthe next ass to rewrit].s the main mpossible exethe previouket to be used
 
nal query. Its the space of is is determinedspace and sse modules anme, the optimizto determine. Tthe planner arso that theare calculated bthe cost mod
:
This modulet are to be conit. All such seer, but usuallyepresented inrm. Because of ated by this mplanning stagdural level.
:
This modulexists for the ee field of stathods are availd hash them toilt on them if / haracteristics of re determinedice is also link determined byin its catalog ethe Statisticponding compimplementatiof any indices [is module sped to approximaterent join methd in general fornd in an execs cost. Given thst of thesehat the systemumptions regarthe specific q. If rewriting isial request is iwell. Thee this stepdule of the oution plans step andfor the reaemploys a rexecution plaby two other mace-mode althe search straer itself, whichhe implementatcompared in tcheapest mthe last twoel and the estidetermines theidered by theries of actions pdiffer in perforrelational algethe algorithmicodule and sente is characteridetermines theecution of eachtistics. This cble for each joiether), as supwhen duplicatother implemey the performed to evidethe physical schtry Given a Stl Space, thislete executionof each al].ify the mathee the cost of exod, for every dievery differentution plan, thee complexity oformulas areactually doesing issues likeuestionknownnored,natureoccursrderingr eachselectstion tosearchs in aodulesebraictegy toshouldions of rms of y beodulesmator-actionlannerroduceance.bra asnatureto the
 
zed aschoiceset of oice isnt (eg,portinges arentationnce of ce anyema of tisticaloduleplans,ebraicaticalcutionfferentind of re is af manysimplend arebuffer
(IJCSIS) International Journal of Computer Science and Information Security,Vol. 9, No. 10, October 2011104http://sites.google.com/site/ijcsis/ISSN 1947-5500

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->