Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

pack-priv Class MaterializedResultSet

extends NoPutResultSetImpl
implements CursorResultSet
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.CursorResultSet, org.apache.derby.iapi.sql.ResultSet
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.execute.CursorResultSet, .ExecRow, .NoPutResultSet, org.apache.derby.iapi.store.access.ConglomerateController, .ScanController, .TransactionController, org.apache.derby.iapi.types.RowLocation

Materialize the underlying ResultSet tree into a temp table on the 1st open. Return rows from temp table on subsequent scans.

Field Summary

Modifier and TypeField and Description
public long
public long
private boolean
protected ConglomerateController
protected long
public boolean
private ExecRow
protected ScanController
public NoPutResultSet
private boolean
private TransactionController
Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
checkNullColsclonedExecRowcncLenresultSetNumbertargetResultSet

Constructor Summary

AccessConstructor and Description
public
MaterializedResultSet(NoPutResultSet
The NoPutResultSet from which to get rows to be materialized
source
,
Activation
The activation for this execution
activation
,
int
The resultSetNumber
resultSetNumber
,
double optimizerEstimatedRowCount, double optimizerEstimatedCost)

Constructor for a MaterializedResultSet

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.close.

Implements org.apache.derby.iapi.sql.ResultSet.close.

If the result set has been opened, close the open scan.

public ExecRow

Returns:

the last row returned.
getCurrentRow
()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

Gets information from last getNextRow call.

public ExecRow
getNextRowCore()

Implements abstract org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRowCore.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.getNextRowCore.

Return the requested values computed from the next row (if any) for which the restriction evaluates to true.

private ExecRow
private ExecRow
public RowLocation

Returns:

the row location of the current cursor row.
getRowLocation
()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getRowLocation.

Gets information from its source.

public long

Returns:

long The total amount of time spent (in milliseconds).
getTimeSpent
(int
CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.
type
)

Implements org.apache.derby.iapi.sql.ResultSet.getTimeSpent.

Return the total amount of time spent in this ResultSet

public void
public void
Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
clearCurrentRowclearOrderableCachecloseRowSourcegetCursorNamegetNextRowFromRowSourcegetResultDescriptiongetValidColumnsisForUpdatemarkRowAsDeletedneedsRowLocationneedsRowLocationForDeferredCheckConstraintsneedsToCloneoffendingRowLocationpositionScanAtRowLocationprintQualifiersresultSetNumberrowLocationsetCurrentRowsetHasDeferrableCheckssetNeedsRowLocationsetTargetResultSetskipRowskipScanunpackHashValueupdateRow

Field Detail

createTCTimeback to summary
public long createTCTime
fetchTCTimeback to summary
public long fetchTCTime
fromSourceback to summary
private boolean fromSource
materializedCCback to summary
protected ConglomerateController materializedCC
materializedCIDback to summary
protected long materializedCID
materializedCreatedback to summary
public boolean materializedCreated
materializedRowBufferback to summary
private ExecRow materializedRowBuffer
materializedScanback to summary
protected ScanController materializedScan
sourceback to summary
public NoPutResultSet source
sourceDrainedback to summary
private boolean sourceDrained
tcback to summary
private TransactionController tc

Hides org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.tc.

Constructor Detail

MaterializedResultSetback to summary
public MaterializedResultSet(NoPutResultSet source, Activation activation, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost) throws StandardException

Constructor for a MaterializedResultSet

Parameters
source:NoPutResultSet

The NoPutResultSet from which to get rows to be materialized

activation:Activation

The activation for this execution

resultSetNumber:int

The resultSetNumber

Exceptions
StandardException:
on error

Method Detail

closeback to summary
public void close() throws StandardException

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.close.

Implements org.apache.derby.iapi.sql.ResultSet.close.

If the result set has been opened, close the open scan.

Exceptions
StandardException:
thrown on error
getCurrentRowback to summary
public ExecRow getCurrentRow()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

Gets information from last getNextRow call.

Returns:ExecRow

the last row returned.

See Also
CursorResultSet
getNextRowCoreback to summary
public ExecRow getNextRowCore() throws StandardException

Implements abstract org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRowCore.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.getNextRowCore.

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.getNextRowCore.

Return the requested values computed from the next row (if any) for which the restriction evaluates to true.

restriction and projection parameters are evaluated for each row.

Returns:ExecRow

the next row in the result

Exceptions
StandardException:
thrown on failure
getNextRowFromSourceback to summary
private ExecRow getNextRowFromSource() throws StandardException
getNextRowFromTempTableback to summary
private ExecRow getNextRowFromTempTable() throws StandardException
getRowLocationback to summary
public RowLocation getRowLocation() throws StandardException

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getRowLocation.

Gets information from its source. We might want to have this take a CursorResultSet in its constructor some day, instead of doing a cast here?

Returns:RowLocation

the row location of the current cursor row.

Exceptions
StandardException:
thrown on failure
See Also
CursorResultSet
getTimeSpentback to summary
public long getTimeSpent(int type)

Implements org.apache.derby.iapi.sql.ResultSet.getTimeSpent.

Return the total amount of time spent in this ResultSet

Parameters
type:int

CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.

Returns:long

long The total amount of time spent (in milliseconds).

openCoreback to summary
public void openCore() throws StandardException

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.openCore.

open a scan on the source. scan parameters are evaluated at each open, so there is probably some way of altering their values...

Exceptions
StandardException:
thrown on failure
reopenCoreback to summary
public void reopenCore() throws StandardException

Overrides org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.reopenCore.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.reopenCore.

reopen a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...

Exceptions
StandardException:
thrown if cursor finished.