- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is query processing and optimization in DBMS?
The activities involved in parsing, validating, execution and optimizing a query is called Query Processing.
The steps involved in query processing and optimization are as follows −
A sequence of primitive operations that can be used to evaluate a query is called query execution plan or query evaluation plan.
The query execution engine takes a query evaluation plan, executes that plan and produces the desired output. The different execution plans for a given query can have different costs based on the number of disks. It is the responsibility of the system to construct a query evaluation plan which minimizes the cost of query evaluation. This task is called query optimization.
A query optimization is expressed in high level query language and is scanned, parsed and validated. The scanner identifies the SQL keywords, attributes and relation names in the text of the query.
The parser checks the syntax which is used to determine if the query is formulated according to syntax rules of the query language.
Finally, the query is evaluated by checking that all attributes and relation names are valid and semantically meaningful in the schema of a particular database.
An internal representation of the query is then created which is either a tree or a graph known as query tree or query graph.
If the query written SQL is translated into relational algebra, then its internal representation is a query tree. Otherwise, if TRC or DRC its internal representation is a query graph. A graph has many possible execution strategies and the process of choosing a strategy with minimum cost is called query optimization.
The query processing and optimization in the DBMS are explained in the form of a diagram below −
- What is query optimization and explain its two forms(DBMS)?
- What is heuristic optimization in DBMS?
- What is Query Optimization?
- What are the steps of SQL Query processing in DBMS?
- What is a query language in DBMS?
- What is transaction processing? Explain the properties of the transaction(DBMS)
- What is Parallel Processing?
- What is batch processing in JDBC?
- What is instance and schema (DBMS)?
- What are copy elision and return value optimization?
- What is morphological gradient in image processing?
- What is Vector Processing in Computer Architecture?
- What are copy elision and return value optimization in C++?
- What is buffering and spooling in a batch processing operating system?
- What is Decomposition in DBMS?