Question: You are given the following SQL query. Assume that for evaluating this query you have 10 buffers available for your use. The size of a

 You are given the following SQL query. Assume that for evaluating

You are given the following SQL query. Assume that for evaluating this query you have 10 buffers available for your use. The size of a buffer is same as size of a page on the disk. The cost of a plan to execute a query is measured in terms of disk accesses. A disk access consists of either reading a single page from disk into a buffer, or writing a buffer onto a single page. Therefore, e.g., the cost of reading 5 pages is 5, irrespective of how and when those 5 pages are read. You are not required to do any duplication removal; this makes projection operator straightforward.

select x.A from r x, s y where x.B = y.B and x.A > 55 and y.H = 100

1. Express the above query as an algebraic expression by converting the from clause to a cross product, where clause to a single selection, and the select clause to a projection.

2. Replace the cross product in the expression of Part 1 by a natural join.

3. Transform the algebraic expression of Part 2 to an expression tree. Your conversion should be literal at this point, without any consideration for algebraic optimization.

4. Estimate the cost of evaluating the expression tree of Part 3. Remember that you have 10 buffers available to you in all parts. Dont forget to use buffers to your advantage whenever you can.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!