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

pack-priv Class MergeJoinResultSet

extends JoinResultSet
Class Inheritance
Imports
org.apache.derby.iapi.services.monitor.Monitor, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.shared.common.stream.HeaderPrintWriter, .InfoStreams, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.Activation, .ResultSet, org.apache.derby.iapi.types.DataValueDescriptor, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.sql.execute.ExecRow, .NoPutResultSet, org.apache.derby.iapi.services.loader.GeneratedMethod

Merge two result sets. The left result set (the outer result set) MUST be unique for this to work correctly.

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private GeneratedMethod
private static final int
Inherited from org.apache.derby.impl.sql.execute.JoinResultSet:
isRightOpenleftNumColsleftResultSetleftRowmergedRownotExistsRightSideoneRowRightSiderestrictionrestrictionTimerightNumColsrightResultSetrightRowrowsReturnedrowsSeenLeftrowsSeenRightuserSuppliedOptimizerOverrides

Constructor Summary

AccessConstructor and Description
pack-priv
MergeJoinResultSet(NoPutResultSet
the left (outer) result set
leftResultSet
,
int
columns in left row
leftNumCols
,
NoPutResultSet
the right (outer) result set
rightResultSet
,
int
columns in right row
rightNumCols
,
Activation
activation
activation
,
GeneratedMethod
a generated method that is used to ascertain whether the row from the left result set is greater than the row from the right result set. returns 1,0,or -1 to indicate greater than, equal, or less than, respectively
leftGreaterThanRight
,
GeneratedMethod
generated method for additional qualification
restriction
,
int
the result set number
resultSetNumber
,
boolean
ignored
oneRowRightSide
,
boolean notExistsRightSide, double
self-explanatory
optimizerEstimatedRowCount
,
double
self-explanatory
optimizerEstimatedCost
)

Create a MergeJoinResultSet

Method Summary

Modifier and TypeMethod and Description
public void
close()

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

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

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

public ExecRow

Returns:

the next row in the join result
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
getReturnRow(ExecRow leftRow, ExecRow rightRow)

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

private boolean
Inherited from org.apache.derby.impl.sql.execute.JoinResultSet:
clearScanStatecloseRightfinishgetCurrentRowgetRowLocationopenCoreopenRightreopenCore

Field Detail

EQUALback to summary
private static final int EQUAL
GREATER_THANback to summary
private static final int GREATER_THAN
leftGreaterThanRightback to summary
private GeneratedMethod leftGreaterThanRight
LESS_THANback to summary
private static final int LESS_THAN

Constructor Detail

MergeJoinResultSetback to summary
pack-priv MergeJoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod leftGreaterThanRight, GeneratedMethod restriction, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost)

Create a MergeJoinResultSet

Parameters
leftResultSet:NoPutResultSet

the left (outer) result set

leftNumCols:int

columns in left row

rightResultSet:NoPutResultSet

the right (outer) result set

rightNumCols:int

columns in right row

activation:Activation

activation

leftGreaterThanRight:GeneratedMethod

a generated method that is used to ascertain whether the row from the left result set is greater than the row from the right result set. returns 1,0,or -1 to indicate greater than, equal, or less than, respectively

restriction:GeneratedMethod

generated method for additional qualification

resultSetNumber:int

the result set number

oneRowRightSide:boolean

ignored

optimizerEstimatedRowCount:double

self-explanatory

optimizerEstimatedCost:double

self-explanatory

Method Detail

closeback to summary
public void close() throws StandardException

Overrides org.apache.derby.impl.sql.execute.JoinResultSet.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
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 requested values computed from the next row (if any) for which the restriction evaluates to true.

restriction parameters are evaluated for each row.

Returns:ExecRow

the next row in the join result

Exceptions
StandardException:
  • Thrown on error
  • ResultSetNotOpen thrown if closed
getReturnRowback to summary
private ExecRow getReturnRow(ExecRow leftRow, ExecRow rightRow) throws StandardException
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).

restrictionIsTrueback to summary
private boolean restrictionIsTrue() throws StandardException