0% found this document useful (0 votes)
47 views

Query Processing Steps

The document outlines 4 steps in the query processing process: 1) Scanning, parsing, and validating the query and converting it to an intermediate form. 2) Using a query optimizer to generate an execution plan. 3) Having a query code generator produce machine code for the execution plan. 4) Executing the query code via a runtime database processor to produce the query result.

Uploaded by

navaneeth
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Query Processing Steps

The document outlines 4 steps in the query processing process: 1) Scanning, parsing, and validating the query and converting it to an intermediate form. 2) Using a query optimizer to generate an execution plan. 3) Having a query code generator produce machine code for the execution plan. 4) Executing the query code via a runtime database processor to produce the query result.

Uploaded by

navaneeth
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Query Processing Steps

Query in high level language

Scanning, Parsing, validating

Intermediate form of query

Query Optimizer

Execution Plan

Query code generator

Code to execute the query

Run time data base processor

Result of query

Step 1
The query expressed in high level language must first scanned,
parsed, validated and converted into an intermediate form.
The scanner identifies the language tokens such as sql keywords,
attribute, names, and relation name in the text of the query.
The parser checks the syntax of the query.
The query must also be validated by checking that all the
attribute names and relation names appearing in the query are
valid (name in the database) and so on.
An internal representation of the query is then created query
tree or query graph.

Step 2
The query optimizer generates a variety of execution and
choose the least expensive one.
Execution plan :- Sequence of primitive operations that can be
used to evaluate a query.
Eg:select balance
from account
where balance > 1000
Two plans are:-

1. balance>1000(balance(account))
2. balance(balance>1000(account))

Step 3
The query code generator produces the machine code to
execute the execution plan.

Step 4
The run time database processor executes the query code and
produce the result. If a run time error result, an error message is
generated.

You might also like