Class MaterializedResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
org.apache.derby.impl.sql.execute.MaterializedResultSet
- All Implemented Interfaces:
CursorResultSet
,NoPutResultSet
,ResultSet
,RowLocationRetRowSource
,RowSource
Materialize the underlying ResultSet tree into a temp table on the 1st open.
Return rows from temp table on subsequent scans.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
BasicNoPutResultSetImpl.FieldComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionlong
long
private boolean
protected ConglomerateController
protected long
boolean
private ExecRow
protected ScanController
private boolean
private TransactionController
Fields inherited from class org.apache.derby.impl.sql.execute.NoPutResultSetImpl
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSet
Fields inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArray
Fields inherited from interface org.apache.derby.iapi.sql.execute.NoPutResultSet
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBER
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
-
Constructor Summary
ConstructorsConstructorDescriptionMaterializedResultSet
(NoPutResultSet source, Activation activation, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost) Constructor for a MaterializedResultSet -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
If the result set has been opened, close the open scan.Gets information from last getNextRow call.Return the requested values computed from the next row (if any) for which the restriction evaluates to true.private ExecRow
private ExecRow
Gets information from its source.long
getTimeSpent
(int type) Return the total amount of time spent in this ResultSetvoid
openCore()
open a scan on the source. scan parameters are evaluated at each open, so there is probably some way of altering their values...void
reopen a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...Methods inherited from class org.apache.derby.impl.sql.execute.NoPutResultSetImpl
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, isForUpdate, markRowAsDeleted, needsRowLocation, needsRowLocationForDeferredCheckConstraints, needsToClone, offendingRowLocation, positionScanAtRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setHasDeferrableChecks, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, unpackHashValue, updateRow
Methods inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
addWarning, attachStatementContext, checkCancellationFlag, checkRowPosition, childrenToXML, cleanUp, dumpTimeStats, finish, finishAndRTS, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCompactRow, getCurrentTimeMillis, getElapsedMillis, getEndExecutionTimestamp, getEstimatedRowCount, getExecuteTime, getExecutionFactory, getFirstRow, getLanguageConnectionContext, getLastRow, getNextRow, getPointOfAttachment, getPreviousRow, getRelativeRow, getRowNumber, getScanIsolationLevel, getSubqueryTrackingArray, getTransactionController, getWarnings, isClosed, isXplainOnlyMode, markAsTopResultSet, modifiedRowCount, open, recordConstructorTime, requiresRelocking, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow, toXML, toXML
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.derby.iapi.sql.ResultSet
addWarning, checkRowPosition, cleanUp, clearCurrentRow, finish, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getWarnings, isClosed, modifiedRowCount, open, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
-
Field Details
-
source
-
materializedRowBuffer
-
materializedCID
protected long materializedCID -
materializedCreated
public boolean materializedCreated -
fromSource
private boolean fromSource -
materializedCC
-
materializedScan
-
tc
-
sourceDrained
private boolean sourceDrained -
createTCTime
public long createTCTime -
fetchTCTime
public long fetchTCTime
-
-
Constructor Details
-
MaterializedResultSet
public MaterializedResultSet(NoPutResultSet source, Activation activation, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost) throws StandardException Constructor for a MaterializedResultSet- Parameters:
source
- The NoPutResultSet from which to get rows to be materializedactivation
- The activation for this executionresultSetNumber
- The resultSetNumber- Throws:
StandardException
- on error
-
-
Method Details
-
openCore
open a scan on the source. scan parameters are evaluated at each open, so there is probably some way of altering their values...- Specified by:
openCore
in interfaceNoPutResultSet
- Throws:
StandardException
- thrown on failure
-
reopenCore
reopen a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...- Specified by:
reopenCore
in interfaceNoPutResultSet
- Overrides:
reopenCore
in classBasicNoPutResultSetImpl
- Throws:
StandardException
- thrown if cursor finished.- See Also:
-
getNextRowCore
Description copied from interface:NoPutResultSet
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.
- Specified by:
getNextRowCore
in interfaceNoPutResultSet
- Specified by:
getNextRowCore
in classBasicNoPutResultSetImpl
- Returns:
- the next row in the result
- Throws:
StandardException
- thrown on failure- See Also:
-
getNextRowFromSource
- Throws:
StandardException
-
getNextRowFromTempTable
- Throws:
StandardException
-
close
If the result set has been opened, close the open scan.- Specified by:
close
in interfaceResultSet
- Overrides:
close
in classNoPutResultSetImpl
- Throws:
StandardException
- thrown on error
-
getTimeSpent
public long getTimeSpent(int type) Return the total amount of time spent in this ResultSet- Specified by:
getTimeSpent
in interfaceResultSet
- Parameters:
type
- CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.- Returns:
- long The total amount of time spent (in milliseconds).
-
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?- Specified by:
getRowLocation
in interfaceCursorResultSet
- Returns:
- the row location of the current cursor row.
- Throws:
StandardException
- thrown on failure- See Also:
-
getCurrentRow
Gets information from last getNextRow call.- Specified by:
getCurrentRow
in interfaceCursorResultSet
- Returns:
- the last row returned.
- See Also:
-