Let there be an unclustered hash index on ProfId and assume that, as before, 5 Professor tuples ?t in one page, 10 Teaching tuples ?t in one page, and the cardinality of Teaching is 10,000. Estimate the cost of computing the above join using index-nested loops and block-nested loops with a 51-page bu?er.

Consider the join Professor  Id=ProfId Teaching used in the running example of Section 11.3. Let us change the statistics slightly and assume that the number of distinct values for Teaching.ProfId is 10,000 (which translates into lower weight for
this attribute).


Since in the previous problem we concluded that Professor has 10,000 tuples and there are 5 tuple/page, this relation will have 2,000 pages. For Teaching,the statistics do not change: 10,000 tuples, 1,000 pages.
For index-nested loops join, we scan Professor and use the index on ProfId to fetch the matching tuples in Teaching. Since there are 10,000 tuples in Teaching and 10,000 values of ProfId, there is 1 matching tuple per value. So, the unclustered nature of the index on ProfId does not matter. There is going to be 1.2*10,000 page transfers in order to ?nd all matching tuples in Teaching plus the cost of the scan of Professor is 2,000. The total cost is 14,000 page transfers.
For the block-nested loops join, we scan the smaller relation, Teaching,in the outer loop. Since we have 51 bu?er pages, we use 49 for Teaching,one for Professor, and one for the output bu?er. Thus, we will scan Professor once for every 49-page block of Teaching: 1000/49 = 21 scans. So, the cost is 21*2,000 + 1,000 = 43,000 page transfers.

Computer Science & Information Technology

You might also like to view...

____ holds instructions that originate from the software that's running.

A. ROM B. Storage C. RAM D. A computer

Computer Science & Information Technology

Identify the letter of the choice that best matches the phrase or definition.

A. A smooth transition from shadows to midtones to highlights B. The relationship between the highlights and the shadows C. A visual reference of every pixel in the image or selection D. Identifying pixel information in the Info panel E. The additive primary colors

Computer Science & Information Technology

After inserting annotations, you can retain them by clicking Discard in the message box that appears when you exit the slide show.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

A troubleshooting strategy that removes components from a system in order to get back to a base configuration is called module replacement.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology