Tutorial5

Tutorial5 - Problem 1: Query Execution Consider the...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Problem 1: Query Execution Consider the following two relations: Students (sid, name, latest-course-id) TakeCourses (sid, cid, cname) where sid, cid, and cname are student id, course id, and course name, respectively. Students has 10,000 tuples, with 25 tuples fitting on a block. TakeCourses has 5,000 tuples, with 50 tuples fitting on a block. There is no index on any attribute of the relations. You may assume the tables are "clustered". (1) Suppose the memory buffer has 101 blocks. Compute the cost of using a block-nested loop join to join the above two relations. (2) Suppose we wanted to join the two relations using a block-nested loop join and limit the cost to 900. What is the smallest value M can be? (3) What is the cost of joining R1 and R2 using a hash-based join?
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Problem 2: Cost Estimation Consider a database with three relations, R1(A,B,C), R2(B,D), R3(C,E,F), with statistics: T(R1)=100 V(R1,A)=100 V(R1,B)=20 V(R1,C)=50 T(R2)=2,000 V(R2,B)=50 V(R2,D)=100
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Tutorial5 - Problem 1: Query Execution Consider the...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online