H.S.Bhathiya(110059X) added section_Query_Optimization_in_Oracle__.tex  about 8 years ago

Commit id: a82450000bdc8e5fc9f07abbab993d500dab5a20

deletions | additions      

         

\section{Query Optimization in Oracle Database}  \subsection{Purpose of the Query Optimizer}  Query optimizer generates the ideal execution for a SQL statement in order to get the the data with the minimum cost.This would take I/O,communication and CPU into consideration  The execution method is dependent on the size of the data set and also the structure of the data set. Query optimizers job is to find the best execution method by considering the above mentioned factors and also the internal access methods.  \subsection{Cost-Based Optimization}  Cost is calculated with reference to the number of resources used for a single query. In this context I/O, CPU , memory and number of rows returned are considered to be resources.There can be multiple ways that resources can be allocated for a query call, the optimiser would assign costs for each methodology and pick the one with the lowest cost. Decision on the same query might change with the Oracle version, this is due to the fact that newer versions have more information compared to the older versions.  \subsection{Execution Plan}  This describes the plan of the execution of the query. Execution plan describes the costs and steps from beginning to the end. Cost are consumed for different cost units of the system.As shown in Figure-3 the, optimizer creates two possible execution plans for the SQL statement. Then using statistics costs are predicted where the plan with the lowest cost being chosen and executed.