CS411 - Query Processing2 Final Scribe

# How do we combine operations the iterator model each

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Execution Plans SELECT S.sname FROM Purchase P, Person Q WHERE P.buyer=Q.name AND Q.city=‘urbana’ AND Q.phone > ‘5430000’ Query Plan: • logical tree • implementation choice at every node • scheduling of operations. buyer σ City=‘urbana’ phone>’5430000’ Buyer=name Purchase (Table scan) (Simple Nested Loops) Person (Index scan) Some operators are from relational algebra, and others (e.g., scan, group) are not. 6 Through query optimization, we can generate a tree as shown. The iterator model is a model that we can use to help the query optimizing process. The iterator model means that you as a programmer will follow 3 functions: Open, GetNext, and Close. How do We Combine Operations? The iterator model. • Each operation is implemented by 3 functions: • Open: sets up the data structures and performs initializations • GetNext: returns the the next tuple of the result. • Close: ends the operations. Cleans up the data structures. • Enables pipelining! 7 The iterator model also enables pipelining. This is simply the process line of different stages where every stage (such as selection, join, etc) is a busy process in some tuple. This means that if we have a multi- core processor, then we are using all cores such that there is no waste in resources. Sellinger: The director of the IBM computer science division. Worked on the system R project and worked on the concept of cost based optimization for queries. Cost Parameters • Cost parameters • M = number of blocks that fit in main memory • B(R) = number of blocks holding R • T(R) = number of tuples in R • V(R,a) = number of...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online