International Journal of Computer Applications (0975 8887) Volume 96No.6, June 2014 1 Reducing Run-time Execution in Query Optimization Rashmi Singh Galgotias College of Engineering and Technology Greater Noida Somesh Sharma Galgotias College of Engineering and Technology Greater Noida Saurabh Singh Galgotias College of Engineering and Technology Greater Noida Bhawna Singh Galgotias College of Engineering and Technology Greater Noida ABSTRACT The main objective of query processor is to generate the most efficient query results. Using an apt execution plan, query minimizes cost of execution for results. The order of accessing a source table is very important during query execution. The best execution plan from possible ones is presented by Query optimizer. The paper discusses various stages of query optimization using execution plan. It gives the analysis of indexes, type of expressions & joins used in the execution plan of the query. The approach gets the estimate of the cost of query joins in a query at compile time. These estimates help in the construction of a query plan at compile time and then executed at run-time. Keywords Execution plan,query optimization,compile time,run time,joins. 1. INTRODUCTION In todays object oriented programming languages, need of optimization of query is increasing. Introduction of various processing methods and constructs are being analysed. These new methods have also shown great results in increasing the comprehensibility of programs and the ability of programmers. In SQL, different execution plans are present to optimize the queries. In other programming languages, the constructs allows queries to be written concisely and concretely. The advantages of using query constructs in place of typical representation are well justified. The queries written using other APIs are less clear and concrete than explicit queries. This method provides an avenue for developers to be more productive and work at a higher level of abstraction. In query processing, there are well described as stages. Firstly, the query processor accepts SQL syntax, secondly selects a plan for executing the syntax, and then executes the chosen plan. Following diagram shows functioning of query processor [1][2][5]. Fig 1: Functioning of query processor. 1.1 Parsing and Semantic Checking For processing SQL query, the database server employs parser to parse the query to perform syntactic and semantic checking of the query. It is done by transforming the query into a parse tree which is the algebraic representation of the query [6] [7] [8]. 1.2 Query Rewrite This step involves only complex query which involves joins, predicates, grouping, etc. In this phase query is presented in the form of an annotated parse tree. Query experiences iterative transformations in accordance to the heuristics used. After that, other steps like joining elimination, predicating normalization, selecting operation are performed and at last, project operation and many transformation rules are performed [9]. 1.3 Query Pre-optimization Phase