Class LastIndexKeyResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
org.apache.derby.impl.sql.execute.ScanResultSet
org.apache.derby.impl.sql.execute.LastIndexKeyResultSet
- All Implemented Interfaces:
NoPutResultSet
,ResultSet
,RowLocationRetRowSource
,RowSource
Return the last key in an index. Used to perform
max().
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
BasicNoPutResultSetImpl.FieldComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionboolean
protected long
protected Qualifier[][]
boolean
protected boolean
protected int
protected int
Fields inherited from class org.apache.derby.impl.sql.execute.ScanResultSet
accessedCols, candidate, fetchRowLocations, indexName, isolationLevel, lockMode, resultRowBuilder, tableName
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
ConstructorsConstructorDescriptionLastIndexKeyResultSet
(Activation activation, int resultSetNumber, int resultRowTemplate, long conglomId, String tableName, String userSuppliedOptimizerOverrides, String indexName, int colRefItem, int lockMode, boolean tableLocked, int isolationLevel, double optimizerEstimatedRowCount, double optimizerEstimatedCost) A last index key result set returns the last row from the index in question. -
Method Summary
Modifier and TypeMethodDescription(package private) boolean
Can we get instantaneous locks when getting share row locks at READ COMMITTED.void
close()
If the result set has been opened, close the open scan.This result set has its row from the last fetch done.Return the next row (if any) from the scan (if open).long
getTimeSpent
(int type) Return the total amount of time spent in this ResultSetvoid
openCore()
open 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.ScanResultSet
getScanIsolationLevel, initIsolationLevel, setRowLocationsState, toXML
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, getSubqueryTrackingArray, getTransactionController, getWarnings, isClosed, isXplainOnlyMode, markAsTopResultSet, modifiedRowCount, open, recordConstructorTime, reopenCore, requiresRelocking, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow, toXML
-
Field Details
-
conglomId
protected long conglomId -
startSearchOperator
protected int startSearchOperator -
stopSearchOperator
protected int stopSearchOperator -
qualifiers
-
userSuppliedOptimizerOverrides
-
runTimeStatisticsOn
protected boolean runTimeStatisticsOn -
stopPositionString
-
coarserLock
public boolean coarserLock -
returnedRow
public boolean returnedRow
-
-
Constructor Details
-
LastIndexKeyResultSet
public LastIndexKeyResultSet(Activation activation, int resultSetNumber, int resultRowTemplate, long conglomId, String tableName, String userSuppliedOptimizerOverrides, String indexName, int colRefItem, int lockMode, boolean tableLocked, int isolationLevel, double optimizerEstimatedRowCount, double optimizerEstimatedCost) throws StandardException A last index key result set returns the last row from the index in question. It is used as an ajunct to max().- Parameters:
activation
- the activation for this result set, which provides the context for the row allocation operation.resultSetNumber
- The resultSetNumber for the ResultSetresultRowTemplate
- The saved item for result row templateconglomId
- the conglomerate of the table to be scanned.tableName
- The full name of the tableuserSuppliedOptimizerOverrides
- Overrides specified by the user on the sqlindexName
- The name of the index, if one used to access table.colRefItem
- An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.lockMode
- The lock granularity to use (see TransactionController in access)tableLocked
- Whether or not the table is marked as using table locking (in sys.systables)isolationLevel
- Isolation level (specified or not) to use on scansoptimizerEstimatedRowCount
- Estimated total # of rows by optimizeroptimizerEstimatedCost
- Estimated total cost by optimizer- Throws:
StandardException
- thrown when unable to create the result set
-
-
Method Details
-
canGetInstantaneousLocks
boolean canGetInstantaneousLocks()Can we get instantaneous locks when getting share row locks at READ COMMITTED.- Specified by:
canGetInstantaneousLocks
in classScanResultSet
-
openCore
open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...- Throws:
StandardException
- thrown on failure to open
-
getNextRowCore
Return the next row (if any) from the scan (if open).- Specified by:
getNextRowCore
in interfaceNoPutResultSet
- Specified by:
getNextRowCore
in classBasicNoPutResultSetImpl
- Returns:
- the next row in the result
- Throws:
StandardException
- thrown on failure to get next row- See Also:
-
close
If the result set has been opened, close the open scan.- Specified by:
close
in interfaceResultSet
- Overrides:
close
in classScanResultSet
- Throws:
StandardException
- thrown on failure to close
-
getTimeSpent
public long getTimeSpent(int type) Return the total amount of time spent in this ResultSet- 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).
-
getCurrentRow
This result set has its row from the last fetch done. If the cursor is closed, a null is returned.- Returns:
- the last row returned;
- Throws:
StandardException
- thrown on failure.- See Also:
-