Google+ Followers


Thursday, September 23, 2010

Query Parsing

What is Query ParsingThis is a featured page ?


In oracle, statement,  DDL/DML, or anything else, gets parsed. Parsing means what Oracle understands about the statement and based on that, how to execute it. This process is also known as Optimization of the query.The idea is how best Oracle can process the query or in other words, optimize its execution.
Parsing is of two types, Hard parse and Soft parse. If the said query is found in Oracle's cache, the query optimization is not needed.Oracle can pick up the optimized query and can execute it. If the query is run for the first time or the query's cached version is obsolete or flushed out from oracle's cache, query needs to be optimized and the process is c called Hard parse of the query. Hard parse , in general , is unavoidable as for the very first time, each query needs to be parsed , atleast for once. But in the subsequent executions, query should be simply soft parsed and executed.
The mechanism which works in the backend for doing all this is called Optimizer. There are two versions of it, Rule Based and Cost Based. The Rule Based optimizer(RBO) is made deprecated from Oracle version release 10g. This was not very much efficient as it was "statement driven". The Cost Based is now the only and supported mode of optimizer which is, as the name suggests, cost based and takes into the account the resource consumption of the query.

No comments:

Post a Comment