What is sql query processing?
SQL Query Processing includes restatements on high position Queries into low position expressions that can be used at physical position of train system, query optimization and factual prosecution of query to get the factual result.
Parser During parse call, the database performs the following checks-Syntax check, Semantic check and Shared pool check, after converting the query into relational algebra.
Parser performs the following checks as ( relate detailed illustration)
Syntax check – concludes SQL syntactic validity. Illustration
SELECT * FORM hand
Then error of wrong spelling of FROM is given by this check.
Semantic check – determines whether the statement is meaningful or not. Illustration query contains a table name which doesn't live is checked by this check.
Shared Pool check – Every query retain a hash law during its prosecution. So, this check determines actuality of written hash law in participated pool if law exists in participated pool also database won't take fresh way for optimization and prosecution.
Hard Parse and Soft Parse –
If there's a fresh query and its hash law doesn't live in participated pool also that query has to pass through from the fresh way known as hard parsing else if hash law exists also query doesn't passes through fresh way.
It just passes directly to prosecution machine ( relate detailed illustration). This is known as soft parsing.
Hard Parse includes following way – Optimizer and Row source generation.
Optimizer During optimization stage, database must perform a hard parse atleast for one unique DML statement and perform optimization during this parse.
This database noway optimizes DDL unless it includes a DML element similar as subquery that bear optimization.
It's a process in which multiple query prosecution plan for satisfying a query are examined and most effective query plan is satisfied for prosecution.
Database roster stores the prosecution plans and also optimizer passes the smallest cost plan for prosecution.
Row Source Generation –
The Row Source Generation is a software that receives a optimal prosecution plan from the optimizer and produces an iterative prosecution plan that's usable by the rest of the database.
The iterative plan is the double program that when executes by the sql machine produces the result set.
Prosecution Machine Eventually runs the query and display the needed result.