next up previous
Next: Block-Oriented Iteration Up: Join Strategies Previous: Join Strategies

Simple Iteration

  1. If we don't create an index, we must examine every pair of tuples tex2html_wrap_inline1084 in deposit and tex2html_wrap_inline1086 in customer. This means examining 10,000 * 200 = 2,000,000 pairs!
  2. If we execute this query cleverly, we can cut down the number of block accesses. We use the following method:

     for each tuple  tex2html_wrap_inline1088  deposit do
    

    begin

    for each tuple tex2html_wrap_inline1090 customer do

    begin

    examine pair (d, c) to see if a

    tuple should be added to the result

    end

    end

  3. Text says further savings are possible if we use customer in the outer loop.
  4. Note that we are considering worst-case number of block reads, where every time a block is needed it is not in the buffer.

    Good buffer management can reduce this considerably.


next up previous
Next: Block-Oriented Iteration Up: Join Strategies Previous: Join Strategies

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