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

pack-priv Class LastIndexKeyResultSet

extends ScanResultSet
Class Inheritance
Imports
org.apache.derby.shared.common.error.StandardException, 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.Qualifier, .TransactionController

Return the last key in an index. Used to perform max().

Field Summary

Modifier and TypeField and Description
public boolean
protected long
protected Qualifier[][]
public boolean
protected boolean
protected int
public String
protected int
public String
Inherited from org.apache.derby.impl.sql.execute.ScanResultSet:
accessedColscandidatefetchRowLocationsindexNameisolationLevellockModeresultRowBuildertableName

Constructor Summary

AccessConstructor and Description
public
LastIndexKeyResultSet(Activation
the activation for this result set, which provides the context for the row allocation operation.
activation
,
int
The resultSetNumber for the ResultSet
resultSetNumber
,
int
The saved item for result row template
resultRowTemplate
,
long
the conglomerate of the table to be scanned.
conglomId
,
String
The full name of the table
tableName
,
String
Overrides specified by the user on the sql
userSuppliedOptimizerOverrides
,
String
The name of the index, if one used to access table.
indexName
,
int
An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.
colRefItem
,
int
The lock granularity to use (see TransactionController in access)
lockMode
,
boolean
Whether or not the table is marked as using table locking (in sys.systables)
tableLocked
,
int
Isolation level (specified or not) to use on scans
isolationLevel
,
double
Estimated total # of rows by optimizer
optimizerEstimatedRowCount
,
double
Estimated total cost by optimizer
optimizerEstimatedCost
)

A last index key result set returns the last row from the index in question.

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
canGetInstantaneousLocks()

Implements abstract org.apache.derby.impl.sql.execute.ScanResultSet.canGetInstantaneousLocks.

Can we get instantaneous locks when getting share row locks at READ COMMITTED.

public void
close()

Overrides org.apache.derby.impl.sql.execute.ScanResultSet.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
()

This result set has its row from the last fetch done.

public ExecRow
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
Inherited from org.apache.derby.impl.sql.execute.ScanResultSet:
getScanIsolationLevelinitIsolationLevelsetRowLocationsStatetoXML

Field Detail

coarserLockback to summary
public boolean coarserLock
conglomIdback to summary
protected long conglomId
qualifiersback to summary
protected Qualifier[][] qualifiers
returnedRowback to summary
public boolean returnedRow
runTimeStatisticsOnback to summary
protected boolean runTimeStatisticsOn
startSearchOperatorback to summary
protected int startSearchOperator
stopPositionStringback to summary
public String stopPositionString
stopSearchOperatorback to summary
protected int stopSearchOperator
userSuppliedOptimizerOverridesback to summary
public String userSuppliedOptimizerOverrides

Constructor Detail

LastIndexKeyResultSetback to summary
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:Activation

the activation for this result set, which provides the context for the row allocation operation.

resultSetNumber:int

The resultSetNumber for the ResultSet

resultRowTemplate:int

The saved item for result row template

conglomId:long

the conglomerate of the table to be scanned.

tableName:String

The full name of the table

userSuppliedOptimizerOverrides:String

Overrides specified by the user on the sql

indexName:String

The name of the index, if one used to access table.

colRefItem:int

An saved item for a bitSet of columns that are referenced in the underlying table. -1 if no item.

lockMode:int

The lock granularity to use (see TransactionController in access)

tableLocked:boolean

Whether or not the table is marked as using table locking (in sys.systables)

isolationLevel:int

Isolation level (specified or not) to use on scans

optimizerEstimatedRowCount:double

Estimated total # of rows by optimizer

optimizerEstimatedCost:double

Estimated total cost by optimizer

Exceptions
StandardException:
thrown when unable to create the result set

Method Detail

canGetInstantaneousLocksback to summary
pack-priv boolean canGetInstantaneousLocks()

Implements abstract org.apache.derby.impl.sql.execute.ScanResultSet.canGetInstantaneousLocks.

Can we get instantaneous locks when getting share row locks at READ COMMITTED.

closeback to summary
public void close() throws StandardException

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

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

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

Exceptions
StandardException:
thrown on failure to close
getCurrentRowback to summary
public ExecRow getCurrentRow() throws StandardException

This result set has its row from the last fetch done. If the cursor is closed, a null is returned.

Returns:ExecRow

the last row returned;

Exceptions
StandardException:
thrown on failure.
See Also
org.apache.derby.iapi.sql.execute.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.

Return the next row (if any) from the scan (if open).

Returns:ExecRow

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

the next row in the result

Exceptions
StandardException:
thrown on failure to get next row
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 table. scan parameters are evaluated at each open, so there is probably some way of altering their values...

Exceptions
StandardException:
thrown on failure to open