A detailed Guide on sql query Optimization This article was published as a part of the


Download 243.81 Kb.
Pdf ko'rish
bet2/7
Sana03.02.2023
Hajmi243.81 Kb.
#1152366
1   2   3   4   5   6   7
Bog'liq
a-detailed-guide-on-sql-query-optimization

Query Processing
Query processing is defined as the group of phases associated with the extraction of data from the
database. It includes conversion of queries written in a high-level language such as SQL into a form that
can be understood by the physical level implementation of the database, SQL query optimization
techniques, and the original evaluation of the query.
There are three major steps involved in query processing:
1. Parser and translator: The first step in query processing is parsing and translation. Parser just like a
parser in compilers checks the syntax of the query whether the relations mentioned are present in the
database or not. A high-level query language such as SQL is suitable for human use. But, it is totally
unsuitable to system internal representation. Therefore, translation is required. The internal representation
can be extended form of relational algebra.


2. Optimization: A SQL query can be written in many different ways. An optimized query also depends on
how the data is stored in the file organization. A Query can also have different corresponding relational
algebra expressions.
So, the above query can be written in the two forms of relational algebra. So it totally depends on the
implementation of the file system which one is better.
3. Execution plan:  A systematic step-by-step execution of primitive operations for fetching data from the
database is termed a query evaluation plan. Different evaluation plans for a particular query have different
query costs. The cost may include the number of disk accesses, CPU time for execution of the query, time
of communication in the case of distributed databases.
Purpose of SQL Query Optimization
The major purposes of SQL Query optimization are:
1. Reduce Response Time: The major goal is to enhance performance by reducing the response time. The
time difference between users requesting data and getting responses should be minimized for a better
user experience.

Download 243.81 Kb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling