next up previous
Next: Natural Join Operation Up: Equivalence of Expressions Previous: Selection Operation

Projection Operation

  1. Like selection, projection reduces the size of relations.

    It is advantageous to apply projections early. Consider this form of our example query:


  2. When we compute the subexpression

      tex2html_wrap_inline884   tex2html_wrap_inline886  

    we obtain a relation whose scheme is
    (cname, ccity, bname, account#, balance)

  3. We can eliminate several attributes from this scheme. The only ones we need to retain are those that
  4. By eliminating unneeded attributes, we reduce the number of columns of the intermediate result, and thus its size.
  5. In our example, the only attribute we need is bname (to join with branch). So we can rewrite our expression as:


  6. Note that there is no advantage in doing an early project on a relation before it is needed for some other operation:

Osmar Zaiane
Sun Jul 26 17:45:14 PDT 1998