

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


November 13, 2008 Database Notes
Query Processing Workflow Inside DBMS Query Optimizer Query (SQL) R.A. Tree
One Many
Many Query Plans
(user side) One
Query Results Execution Plan
Query 1: SELECT E.name Π FROM Employee, Works_On WHERE E.ssn = W_O.Essn (1) AND E.b_date < ‘11/13/78’ (2) σ 1 x 2 x 3 AND W_O.Pno = 100; (3)
R.A. = Π E.name (σ __ (E x W_O)) x
Π E W_O
σ b_date < __ σ Pno = 100 σ b_date < __
W_O E σ Pno = 100 E
*different ways to describe one query with relational algebra
By using a complete set of Equivalence Rules (ER), we can enumerate all R.A. Trees.
Query Parser
Plan Generator
Cost Model
Query Executer
Query Plan: a Q.P. is a R.A. Tree augmented with algorithms to accomplish R.A. operations.
3 x 3 x 3 = 27 different 3 plans based on the tree (alg. 6)
(alg. 1) σ Pno = 100 σ b_date < __ (alg. 3)
*Each tree can have a great number of plans using algorithms
Algorithms for processing R.A. Operators
Complex Selections – Selection with conditions on more than one attribute The usage of indexes has profound effects on complex selection in terms of performance. Some Rules:
*Only Query 1 can be used w/ the hash index (hash does not work on ranged functions)