org.teiid.query.processor.relational
Class EnhancedSortMergeJoinStrategy

java.lang.Object
  extended by org.teiid.query.processor.relational.JoinStrategy
      extended by org.teiid.query.processor.relational.MergeJoinStrategy
          extended by org.teiid.query.processor.relational.EnhancedSortMergeJoinStrategy

public class EnhancedSortMergeJoinStrategy
extends MergeJoinStrategy

Extends the basic fully sorted merge join to check for conditions necessary to not fully sort one of the sides. Will be used for inner joins and only if both sorts are not required. Degrades to a normal merge join if the tuples are balanced. Refined in 7.4 to use a full index if it is small enough or a repeated merge, rather than a partitioning approach (which was really just a single level index)


Nested Class Summary
 
Nested classes/interfaces inherited from class org.teiid.query.processor.relational.MergeJoinStrategy
MergeJoinStrategy.SortOption
 
Field Summary
 
Fields inherited from class org.teiid.query.processor.relational.MergeJoinStrategy
processingSortLeft, processingSortRight, sortLeft, sortRight
 
Fields inherited from class org.teiid.query.processor.relational.JoinStrategy
joinNode, leftSource, rightSource
 
Constructor Summary
EnhancedSortMergeJoinStrategy(MergeJoinStrategy.SortOption sortLeft, MergeJoinStrategy.SortOption sortRight)
           
 
Method Summary
 EnhancedSortMergeJoinStrategy clone()
           
 void close()
           
 void createIndex(org.teiid.query.processor.relational.SourceState state, boolean sorted)
          Create an index of the smaller size TODO: reuse existing temp table indexes
 java.lang.String getName()
           
protected  void loadLeft()
           
protected  void loadRight()
           
protected  void process()
           
 void setPreferMemCutoff(int cutoff)
           
 
Methods inherited from class org.teiid.query.processor.relational.MergeJoinStrategy
compare, compareToPrevious, initialize, resetMatchState, setProcessingSortRight, toString
 
Methods inherited from class org.teiid.query.processor.relational.JoinStrategy
openLeft, openRight, outputTuple
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnhancedSortMergeJoinStrategy

public EnhancedSortMergeJoinStrategy(MergeJoinStrategy.SortOption sortLeft,
                                     MergeJoinStrategy.SortOption sortRight)
Method Detail

setPreferMemCutoff

public void setPreferMemCutoff(int cutoff)

close

public void close()
Overrides:
close in class MergeJoinStrategy
See Also:
JoinStrategy.close()

createIndex

public void createIndex(org.teiid.query.processor.relational.SourceState state,
                        boolean sorted)
                 throws TeiidComponentException,
                        TeiidProcessingException
Create an index of the smaller size TODO: reuse existing temp table indexes

Throws:
TeiidComponentException
TeiidProcessingException

loadLeft

protected void loadLeft()
                 throws TeiidComponentException,
                        TeiidProcessingException
Overrides:
loadLeft in class MergeJoinStrategy
Throws:
TeiidComponentException
TeiidProcessingException

loadRight

protected void loadRight()
                  throws TeiidComponentException,
                         TeiidProcessingException
Overrides:
loadRight in class MergeJoinStrategy
Throws:
TeiidComponentException
TeiidProcessingException

process

protected void process()
                throws TeiidComponentException,
                       TeiidProcessingException
Overrides:
process in class MergeJoinStrategy
Throws:
TeiidComponentException
TeiidProcessingException

clone

public EnhancedSortMergeJoinStrategy clone()
Overrides:
clone in class MergeJoinStrategy
See Also:
JoinStrategy.clone()

getName

public java.lang.String getName()
Overrides:
getName in class MergeJoinStrategy


Copyright © 2011. All Rights Reserved.