
































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!

































2
parse
convert
apply laws
estimate result sizes
consider physical plans estimate costs
pick best
execute
{(P1,C1),(P2,C2)...}
Pi
answer
SQL query
parse tree
logical query plan
“improved” l.q.p
l.q.p. +sizes
statistics
Example: SQL query
SELECT title FROM StarsIn WHERE starName IN ( SELECT name FROM MovieStar WHERE birthdate LIKE ‘%1960’ );
(Find the movies with stars born in 1960)
is converted into
PROJ att-list (SELECT cond (PRODUCT( rel-list ))), or
SELECT movieTitle FROM StarsIn, MovieStar WHERE starName = name AND birthdate LIKE '%1960';
11
SELECT
movieTitle StarsIn
MovieStar birthdate '%1960'
starName name
14
Πtitle
σ
StarsIn
starName MovieStar
16
σ
R
t IN S R^ δ S
σ
C is the condition that equates attributes in t with corresponding attributes in S
17
StarsIn
MovieStar