Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider a join RR.A-S.B S. We ignore the cost of output the result and measure the cost with the number of I/O the number

Consider a join RR.A-S.B S. We ignore the cost of output the result and measure the cost with the number of I/O the number of data blocks that need to be transferred. Given the information about relations to be joined below: (1) Relation S contains 20K tuples and has 10 tuples per block; (2) Relation R contains 100K tuples and has 10 tuples per block. (3) Attribute B of S is the primary key of S. In total 52 pages (blocks) are available in memory. a. (10) Assume neither relation has any index. Describe a block nested join algorithm to evaluate the query. Give the cost of joining R and S with a block nested loops join. b. (20) Assume R contains 1000 blocks, 10,000 tuples; S contains 10,000 blocks, 50,000 tuples. There are clustering B+ tree index on R.A and S.B. Both indexes contain two levels with the root note in the first level and all leaf nodes in the second level. The indexes on R.A has 25 leaf nodes; the index on S.B contain 250 leaf nodes. Describe *two* algorithms that can correctly compute GR.ARRA-S.B S and give the corresponding cost measured by the number of block transfers. (There are multiple solutions; describing any two correct algorithms with cost analysis suffice).

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Accounting and Reporting a Global Perspective

Authors: Michel Lebas, Herve Stolowy, Yuan Ding

4th edition

978-1408066621, 1408066629, 1408076861, 978-1408076866

More Books

Students also viewed these Programming questions

Question

2 xy + 4 = 3 4 where y = 3

Answered: 1 week ago