Nuwan Wajirasena(110607D) edited section_Query_Optimization_in_Oracle__.tex  about 8 years ago

Commit id: 1d7ca8241ef1b69d23eafc8c70f1d1bdc5f1e491

deletions | additions      

       

Query optimizer generates the ideal execution for a SQL statement in order to get 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 \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 optimizer 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 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.