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:

      tex2html_wrap_inline842 
     tex2html_wrap_inline880 
     tex2html_wrap_inline882  
    

  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:

      tex2html_wrap_inline842 
     tex2html_wrap_inline890 
     tex2html_wrap_inline892  
    

  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