java.lang.Cloneable
, CursorResultSet
, NoPutResultSet
, ResultSet
, RowLocationRetRowSource
, RowSource
class BulkTableScanResultSet extends TableScanResultSet implements CursorResultSet
Since it retrieves rows in bulk, locking is not as is usual -- locks may have already been released on rows as they are returned to the user. Hence, this ResultSet is not suitable for a query running Isolation Level 1, cursor stability.
Note that this code is only accessable from an optimizer override. If it makes sense to have the optimizer select bulk reads, then this should probably be rolled into TableScanResultSet.
BasicNoPutResultSetImpl.FieldComparator
Modifier and Type | Field | Description |
---|---|---|
private int |
baseColumnCount |
|
private int |
curRowPosition |
|
private int |
numRowsInArray |
|
private static int |
OUT_OF_ROWS |
|
private int |
resultColumnCount |
|
private DataValueDescriptor[][] |
rowArray |
|
private RowLocation[] |
rowLocations |
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArray
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBER
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
accessedCols, candidate, fetchRowLocations, indexName, isolationLevel, lockMode, resultRowBuilder, tableName
coarserLock, conglomId, currentRowIsValid, dcoci, firstScan, forUpdate, indexCols, isConstraint, isKeyed, nextDone, oneRowScan, past2FutureTbl, qualifiers, qualify, rowsPerRead, rowsThisScan, runTimeStatisticsOn, sameStartStopPosition, scanController, scanControllerOpened, scanRepositioned, scoci, startKeyGetter, startPosition, startPositionString, startSearchOperator, stopKeyGetter, stopPosition, stopPositionString, stopSearchOperator, userSuppliedOptimizerOverrides
Constructor | Description |
---|---|
BulkTableScanResultSet(long conglomId,
StaticCompiledOpenConglomInfo scoci,
Activation activation,
int resultRowTemplate,
int resultSetNumber,
GeneratedMethod startKeyGetter,
int startSearchOperator,
GeneratedMethod stopKeyGetter,
int stopSearchOperator,
boolean sameStartStopPosition,
Qualifier[][] qualifiers,
java.lang.String tableName,
java.lang.String userSuppliedOptimizerOverrides,
java.lang.String indexName,
boolean isConstraint,
boolean forUpdate,
int colRefItem,
int indexColItem,
int lockMode,
boolean tableLocked,
int isolationLevel,
int rowsPerRead,
boolean disableForHoldable,
boolean oneRowScan,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
private static int |
adjustBulkFetchSize(Activation activation,
int rowsPerRead,
boolean disableForHoldable) |
Adjust the bulk fetch size according to the parameters.
|
protected boolean |
canGetInstantaneousLocks() |
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.
|
ExecRow |
getNextRowCore() |
Return the next row (if any) from the scan (if open).
|
private DataValueDescriptor[] |
lopOffRowLocation() |
Get a blank row by cloning the candidate row and lopping off
the trailing RowLocation column for scans done on
behalf of MERGE statements.
|
void |
openCore() |
Open up the result set.
|
protected void |
openScanController(TransactionController tc) |
Open the scan controller
|
private int |
reloadArray() |
|
void |
reopenCore() |
Reopen the result set.
|
boolean |
requiresRelocking() |
Do we need to relock the row when going to the heap.
|
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, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow, toXML
getCurrentRow, getRowLocation
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, markRowAsDeleted, needsRowLocation, needsRowLocationForDeferredCheckConstraints, needsToClone, offendingRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setHasDeferrableChecks, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, unpackHashValue, updateRow
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addWarning, checkRowPosition, cleanUp, clearCurrentRow, finish, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getTimeSpent, getWarnings, isClosed, modifiedRowCount, open, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
getScanIsolationLevel, initIsolationLevel, setRowLocationsState, toXML
clone, getCurrentRow, getRowLocation, getScanProperties, getTimeSpent, initStartAndStopKey, isForUpdate, loopControl, positionScanAtRowLocation, printStartPosition, printStopPosition, reopenScanController, setRowCountIfPossible
private DataValueDescriptor[][] rowArray
private RowLocation[] rowLocations
private int curRowPosition
private int numRowsInArray
private int baseColumnCount
private int resultColumnCount
private static int OUT_OF_ROWS
BulkTableScanResultSet(long conglomId, StaticCompiledOpenConglomInfo scoci, Activation activation, int resultRowTemplate, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, java.lang.String tableName, java.lang.String userSuppliedOptimizerOverrides, java.lang.String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, int rowsPerRead, boolean disableForHoldable, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost) throws StandardException
StandardException
- thrown on failure to openResultSetFactory.getBulkTableScanResultSet(org.apache.derby.iapi.sql.Activation, long, int, int, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, org.apache.derby.iapi.services.loader.GeneratedMethod, int, boolean, org.apache.derby.iapi.store.access.Qualifier[][], java.lang.String, java.lang.String, java.lang.String, boolean, boolean, int, int, int, boolean, int, int, boolean, boolean, double, double)
private static int adjustBulkFetchSize(Activation activation, int rowsPerRead, boolean disableForHoldable)
activation
- the activation for the executing statementrowsPerRead
- how many rows to read in each chunk if a bulk fetch
is OK to usedisableForHoldable
- whether or not bulk fetch should be disabled
for holdable cursorsprotected void openScanController(TransactionController tc) throws StandardException
openScanController
in class TableScanResultSet
tc
- transaction controller will open one if nullStandardException
- thrown on failure to openpublic void openCore() throws StandardException
openCore
in interface NoPutResultSet
openCore
in class TableScanResultSet
StandardException
- thrown on failure to openprivate DataValueDescriptor[] lopOffRowLocation() throws StandardException
StandardException
public void reopenCore() throws StandardException
reopenCore
in interface NoPutResultSet
reopenCore
in class TableScanResultSet
StandardException
- thrown on failure to openNoPutResultSet.openCore()
public ExecRow getNextRowCore() throws StandardException
getNextRowCore
in interface NoPutResultSet
getNextRowCore
in class TableScanResultSet
StandardException
- thrown on failure to get next rowNoPutResultSet.getNextRowCore()
private int reloadArray() throws StandardException
StandardException
public void close() throws StandardException
close
in interface ResultSet
close
in class TableScanResultSet
StandardException
- on errorprotected boolean canGetInstantaneousLocks()
canGetInstantaneousLocks
in class TableScanResultSet
public boolean requiresRelocking()
NoPutResultSet
requiresRelocking
in interface NoPutResultSet
requiresRelocking
in class TableScanResultSet
NoPutResultSet.requiresRelocking()
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.