Tutorial5

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

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

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?

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

View Full Document
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
This is the end of the preview. Sign up to access the rest of the document.

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

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

View Full Document
Ask a homework question - tutors are online