Introduction to query Processing
Introduction to query Processing
Processing
Basics of Query Processing
1.Query Processing includes translations of high-level Queries into low-level expressions
that can be used at the physical level of the file system,
2.High-level queries are converted into low-level expressions during query processing.
3.It is a methodical procedure that can be applied at the physical level of the file system
Definition -The process of extracting data from a database is called query processing. It
requires several steps to retrieve the data from the database during query processing. The
actions involved actions are:
1.Parsing and translation
2.Optimization
3.Evaluation
Basic of Query Processing
Detailed Query Processing
1.Parsing
During the parse call, the database performs the following checks: Syntax check,
Semantic check, and Shared pool check, after converting the query into relational
algebra because certain activities for data retrieval are included in query processing.
Steps in Parsing
1.Semantic check - syntax check and also spelling check
Eg select * form employee
2.Optimization:the database must perform a hard parse at least for one unique DML
statement and perform optimization during this parse. This database never optimizes
DDL unless it includes a DML component such as a subquery that requires
optimization. The database catalog stores the execution plans and then the optimizer
passes the lowest-cost plan for execution.
Step-3 Evaluation
Finally runs the query and displays the required result.
SQL Query Optimization
1. Use Indexes
2. Use WHERE Clause instead of having :WHERE query execute more quickly than HAVING.
WHERE filters are recorded before groups are created and HAVING filters are recorded after the
creation of groups.
9.Consider Denormalization
10. Optimize JOIN Operations