com.lucidera.lcs
Class LcsIndexOnlyScanRel
java.lang.Object
org.eigenbase.rel.AbstractRelNode
org.eigenbase.rel.SingleRel
net.sf.farrago.fennel.rel.FennelSingleRel
net.sf.farrago.fennel.rel.FennelOptionalRel
com.lucidera.lcs.LcsIndexOnlyScanRel
- All Implemented Interfaces:
- Cloneable, FennelRel, RelNode
public class LcsIndexOnlyScanRel
- extends FennelOptionalRel
A relation for performing an index only scan of a table (as opposed to
performing a regular row scan). It may have the benefit of a sorted result
set.
- Version:
- $Id: //open/dev/farrago/src/com/lucidera/lcs/LcsIndexOnlyScanRel.java#11 $
- Author:
- John Pham
Constructor Summary |
|
LcsIndexOnlyScanRel(LcsRowScanRel rowScan,
FemLocalIndex index,
Integer[] proj)
Constructs an index-only scan from a row scan. |
|
LcsIndexOnlyScanRel(RelOptCluster cluster,
RelNode child,
LcsIndexSearchRel searchRel,
FemLocalIndex index,
Integer[] proj)
Constructs an index only scan based upon another index scan. |
private |
LcsIndexOnlyScanRel(RelOptCluster cluster,
RelNode child,
LcsTable table,
FemLocalIndex index,
boolean fullScan,
Integer[] projectedColumns,
boolean isUniqueKey,
boolean isOuter,
Integer[] inputKeyProj,
Integer[] inputJoinProj,
Integer[] inputDirectiveProj)
Common method for creating an index only scan |
Methods inherited from class org.eigenbase.rel.AbstractRelNode |
cloneTraits, collectVariablesSet, collectVariablesUsed, computeDigest, computeSelfCost, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRowType, getTable, getTraits, getVariablesStopped, inheritTraitsFrom, isAccessTo, isDistinct, isValid, onRegister, recomputeDigest, register, registerCorrelVariable, setCorrelVariable, toString |
Methods inherited from interface org.eigenbase.rel.RelNode |
collectVariablesSet, collectVariablesUsed, computeSelfCost, getChildExps, getCluster, getCollationList, getConvention, getCorrelVariable, getDescription, getDigest, getExpectedInputRowType, getId, getInput, getOrCreateCorrelVariable, getQuery, getRelTypeName, getRowType, getTable, getTraits, getVariablesStopped, isAccessTo, isDistinct, isValid, onRegister, recomputeDigest, registerCorrelVariable, replaceInput, setCorrelVariable |
fullScan
private final boolean fullScan
projectedColumns
private final Integer[] projectedColumns
isUniqueKey
private final boolean isUniqueKey
isOuter
private final boolean isOuter
inputKeyProj
private final Integer[] inputKeyProj
inputJoinProj
private final Integer[] inputJoinProj
inputDirectiveProj
private final Integer[] inputDirectiveProj
table
private final LcsTable table
index
private final FemLocalIndex index
LcsIndexOnlyScanRel
public LcsIndexOnlyScanRel(RelOptCluster cluster,
RelNode child,
LcsIndexSearchRel searchRel,
FemLocalIndex index,
Integer[] proj)
- Constructs an index only scan based upon another index scan. The index
scan already has an input.
- Parameters:
cluster
- the environment for the scanchild
- the index scan input, which produces search directivessearchRel
- the index search to be converted into an index only scanindex
- index to be scanned, may differ from the one in searchRelproj
- keys to be projected from the index
LcsIndexOnlyScanRel
public LcsIndexOnlyScanRel(LcsRowScanRel rowScan,
FemLocalIndex index,
Integer[] proj)
- Constructs an index-only scan from a row scan.
- Parameters:
rowScan
- row scanindex
- the index to be scannedproj
- keys to be projected from the index
LcsIndexOnlyScanRel
private LcsIndexOnlyScanRel(RelOptCluster cluster,
RelNode child,
LcsTable table,
FemLocalIndex index,
boolean fullScan,
Integer[] projectedColumns,
boolean isUniqueKey,
boolean isOuter,
Integer[] inputKeyProj,
Integer[] inputJoinProj,
Integer[] inputDirectiveProj)
- Common method for creating an index only scan
- Parameters:
cluster
- the environment for the scanchild
- the child of the scantable
- the table of the index to be scannedindex
- the index to be scannedfullScan
- true if the entire index is being scannedprojectedColumns
- for full scans, the output projection. Should be
null for searchesisUniqueKey
- TODOisOuter
- TODOinputKeyProj
- for searches, the key columnsinputJoinProj
- for index joins applied to searches, the input keys
to be outputinputDirectiveProj
- for searches, the search directive columns
clone
public LcsIndexOnlyScanRel clone()
- Description copied from interface:
RelNode
- Clones this RelNode.
Traits of the RelNode must be explicitly cloned, using AbstractRelNode.inheritTraitsFrom(AbstractRelNode)
, as the RelNode may
have traits of which it has no knowledge. Example implementation:
public MyRelNode clone()
{
MyRelNode clone = new MyRelNode(...);
clone.inheritTraitsFrom(this);
return clone;
}
N.B.: This method must be overridden whenever an existing,
concrete RelNode is extended. Otherwise, calling clone() will produce a
differently typed RelNode, resulting in invalid or incorrect query plans.
- Specified by:
clone
in interface RelNode
- Specified by:
clone
in class AbstractRelNode
- Returns:
- a clone of this RelNode
deriveRowType
protected RelDataType deriveRowType()
- Overrides:
deriveRowType
in class SingleRel
explain
public void explain(RelOptPlanWriter pw)
- Specified by:
explain
in interface RelNode
- Overrides:
explain
in class SingleRel
toStreamDef
public FemExecutionStreamDef toStreamDef(FennelRelImplementor implementor)
- Description copied from interface:
FennelRel
- Converts this relational expression to
FemExecutionStreamDef
form. In the process, the relational expression will almost certainly
call FennelRelImplementor.visitFennelChild(net.sf.farrago.query.FennelRel, int)
on each of its
children.
- Parameters:
implementor
- for generating Java code
- Returns:
- generated FemExecutionStreamDef
getOutputProj
public Integer[] getOutputProj()