CISC437 Lecture Notes - Lecture 24: Relational Algebra, Mysql, Query Language
Document Summary
Optimize to form lowest cost evaluation plan: consider equivalent relational algebra queries, consider available indexes and file storage types, consider possible algorithms for each relational algebra operator in the query. There are many, many ways to process any given query. You can see how the dbms processes a query using explain keyword. Relational algebra is a query language based on application of operators to relations. 5 basic operations: selection ( , projection ( , cross product (x, set union, set difference. Each operator takes one or two relations as input and has 1 output. A query can be drawn as a tree structure. Using explain keyword on select * from table, we see that: Implements the select [fields] part of a sql query. Full table scan, adding values that are in the field list to the result set. Index scan, adding search key values in the field list to the result set.