Query Evaluation Fundamentals SQL is Complex - Reduce to "Relational Algebra" Deal with Nested Queries one block at a time Issue of Correlation Variables For each block build up a query tree with operators at nodes Most operators are unary, joins are binary Operators of greatest interest are selections, projections, and joins "Sort" may also be an "operator" - the form of the data is important Notion of "Physical Algebra" Pipelining Intermediate Results can be large - must count cost for writing/reading Avoid writing intermediate results if possible - pipelining Structure Code as recursive calls, top-down. Each operator supports open, close and get_next For scan over relation, gives rise to concept of cursor "Blocking Operators", e.g. sorting, may do all their work on the open Internet/XML Query Processing Structured Join -- Join based on position rather than value Non-blocking join -- required when inputs may take a long time to complete