Escolar Documentos
Profissional Documentos
Cultura Documentos
Saiful Islam
Assistant Professor
Department of Computer Science and Engg.
University of Rajshahi
1.2 What is Query Optimization?
Given a query, there are generally a variety of methods for computing
the answer.
The first action the system must take on a query is to translate the query
into its internal form.
In the process of generating the internal form of the query, the parser
checks the syntax of the users query, verifies the relation name, etc.
If the query was expressed in terms of a view, the parser replaces all
references to the view name with the relational algebra expression to
compute a view.
Teaches Course
1.3.1 Selection Operation:
Query: Find teacher name, course number and title for all who
live in city Dhaka.
This expression construct a large relation.
Dense Index:
An index record appears for every search key value in the file.
Sparse Index:
Index record is created for only some of the records.
Another index classification is clustering and non-
clustering.
Clustering:
In clustering index, the physical order of the index
records is the same as the logical order.
Non-clustering:
In non-clustering index, the physical order of the index
records is not the same as the logical order and hence one
block access is required for one record.
3.3 Estimation of Cost of Access Using Index:
To illustrate, consider the query: Find account number of a customer in
branch RU and balance>1000.