Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views5 pages

Query Processing

Uploaded by

fabsintt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views5 pages

Query Processing

Uploaded by

fabsintt
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 5

Query

Processing
Basic Steps in Query
Processing
1. Parsing and translation
2. Optimization
3. Evaluation
Basic Steps in Query Processing
(Cont.)
 Parsing and translation

 translate the query into its internal form. This is then


translated into relational algebra.
 Parser checks syntax, verifies relations
 Evaluation
 The query-execution engine takes a query-evaluation
plan, executes that plan, and returns the answers to
the query.
Basic Steps in Query Processing :
Optimization

 A relational algebra expression may have many


equivalent expressions
 E.g., salary75000(salary(instructor)) is equivalent to
salary(salary75000(instructor))
 Each relational algebra operation can be evaluated using
one of several different algorithms
 Correspondingly, a relational-algebra expression can
be evaluated in many ways.
 Annotated expression specifying detailed evaluation
strategy is called an evaluation-plan.
 E.g., can use an index on salary to find instructors with
salary < 75000,
 or can perform complete relation scan and discard
instructors with salary  75000
Basic Steps: Optimization
(Cont.)

 Query Optimization: Amongst all


equivalent evaluation plans choose the one
with lowest cost.
 Cost is estimated using statistical
information from the
database catalog
 e.g. number of tuples in each relation,
size of tuples, etc.

You might also like