CS411-11-QueryOptimization - Note 1 - 2 - 3

Algebraic laws example 01

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: revious slide, • Given B(R), B(S), B(T), B(U) Cost = B(R) + B(S) + B(T)+ B(U). • What is the total cost of the plan ? Memory = B(S) + B(T) + B(U). • Cost = (The instructor wrote B(S) + B(R) + B(T), but I think it should be wrong. ) • How much main memory do we need ? • M = Completing Physical Query Plan (5 of 13) Query Optimization (46 of 64) Compared with the Materializing method, the pipeline method does not need to write the result into the disk during the procedure and therefore occupies more memory. The instructor skipped this slide. Completing the Physical Query Plan • Choose algorithm to implement each operator • Need to account for more than cost: • How much memory do we have ? • Are the input operand(s) sorted ? • Decide for each intermediate result: • To materialize • To pipeline Completing Physical Query Plan (6 of 13) Query Optimization (47 of 64) In the 101 buffers, 1 should be hold for input buffer. Example • Logical plan is: k blocks If k is very big, we should use materializing, because we need to write the bucket out; If k is very small, we could use pipeline method, because we could save the bucket into the memory. U(y,z) 10,000 blocks R(w,x) S(x,y) 5,000 blocks 10,000 blocks • Main memory M = 101 buffers Completing Physical Query Plan (7 of 13) Query Optimization (48 of 64) R, S, U can all be hashed because blocks of R,S,U <= M^2=10000 Example k blocks Naïve method: simply do fully materialization on intermediate result into disk without considering how big K is. U(y,z) 10,000 blocks R(w,x) S(x,y) 5,000 blocks 10,000 blocks • Naïve evaluation:...
View Full Document

This note was uploaded on 01/28/2014 for the course CS 411 taught by Professor Staff during the Fall '08 term at University of Illinois, Urbana Champaign.

Ask a homework question - tutors are online