org.axiondb.engine.rowiterators
Class IndexNestedLoopJoinedRowIterator

java.lang.Object
  extended by org.axiondb.engine.rowiterators.BaseRowIterator
      extended by org.axiondb.engine.rowiterators.AbstractJoinedRowIterator
          extended by org.axiondb.engine.rowiterators.IndexNestedLoopJoinedRowIterator
All Implemented Interfaces:
RowIterator

public class IndexNestedLoopJoinedRowIterator
extends AbstractJoinedRowIterator

The Index Nested Loop Join or Augmented Nested Loop Join (ANL) is by far the most common join method and is the classic Axion join method. An augmented nested loop join is performed by doing a scan over the left subtree and for each row in it, performing an index bracket scan on a portion of the right subtree. The right subtree is read as many times as there are rows in the left subtree. To be a candidate for an ANL join, the subtree pair for a join node must meet the following criteria:

  • There must be an index(es) defined on the join column(s) for the table in the right subtree.
  • No other scan on that index has already been set.

    When there is an index defined on the left subtree?s table instead of on the right, the optimizer swaps the subtrees to make an ANL join possible. When neither subtree?s table has an index defined on the join column, the optimizer creats a dynamic index on one of the subtree.

    Version:
    $Revision: 1.3 $ $Date: 2005/04/02 18:23:30 $

    Constructor Summary
    IndexNestedLoopJoinedRowIterator(RowIterator left, int leftJoinColumn, MutableIndexedRowIterator rightIndex, int rightColumnCount, boolean rightOuter, boolean swapLeftAndRight)
               
     
    Method Summary
    protected  RowIterator generateRightRowIterator()
               
     java.lang.String toString()
               
     
    Methods inherited from class org.axiondb.engine.rowiterators.AbstractJoinedRowIterator
    current, currentIndex, getJoinCondition, getLeftRowIterator, getRightSideColumnCount, getRowDecorator, hasCurrent, hasNext, hasPrevious, isRightOuter, isSwapLeftAndRight, next, nextIndex, previous, previousIndex, reset, setJoinCondition, setLeftRowIterator, setRightOuter, setRightSideColumnCount, setSwapLeftAndRight
     
    Methods inherited from class org.axiondb.engine.rowiterators.BaseRowIterator
    add, first, isEmpty, last, next, peekNext, peekPrevious, previous, remove, set, size
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
     

    Constructor Detail

    IndexNestedLoopJoinedRowIterator

    public IndexNestedLoopJoinedRowIterator(RowIterator left,
                                            int leftJoinColumn,
                                            MutableIndexedRowIterator rightIndex,
                                            int rightColumnCount,
                                            boolean rightOuter,
                                            boolean swapLeftAndRight)
                                     throws AxionException
    Throws:
    AxionException
    Method Detail

    generateRightRowIterator

    protected RowIterator generateRightRowIterator()
                                            throws AxionException
    Specified by:
    generateRightRowIterator in class AbstractJoinedRowIterator
    Throws:
    AxionException

    toString

    public java.lang.String toString()
    Overrides:
    toString in class AbstractJoinedRowIterator