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.
Do'stlaringiz bilan baham: