Top Description Fields Constructors Methods
org.h2.index

public Class LinkedIndex

extends Index
Class Inheritance
Imports
java.sql.PreparedStatement, .ResultSet, java.util.ArrayList, org.h2.command.query.AllColumnsForPlan, org.h2.engine.Constants, .SessionLocal, org.h2.message.DbException, org.h2.result.Row, .SearchRow, .SortOrder, org.h2.table.Column, .IndexColumn, .TableFilter, .TableLink, org.h2.util.Utils, org.h2.value.TypeInfo, .Value, .ValueNull

A linked index is a index for a linked (remote) table. It is backed by an index on the remote table which is accessed over JDBC.

Field Summary

Modifier and TypeField and Description
private final TableLink
private long
private final int
private final String
Inherited from org.h2.index.Index:
columnIdscolumnsindexColumnsindexTypetableuniqueColumnColumn

Constructor Summary

AccessConstructor and Description

Method Summary

Modifier and TypeMethod and Description
public void
add(SessionLocal
the session to use
session
,
Row
the row to add
row
)

Implements abstract org.h2.index.Index.add.

Add a row to the index.

private void
private void
public void
checkRename()

Overrides org.h2.engine.DbObject.checkRename.

Check if renaming is allowed.

public void
close(SessionLocal
the session used to write data
session
)

Implements abstract org.h2.index.Index.close.

Close this index.

public Cursor
find(SessionLocal
the session
session
,
SearchRow
the first row, or null for no limit
first
,
SearchRow
the last row, or null for no limit
last
,
boolean
if true, iterate in reverse (descending) order
reverse
)

Implements abstract org.h2.index.Index.find.

Find a row or a list of rows and create a cursor to iterate over the result.

public double
getCost(SessionLocal
the session
session
,
int[]
per-column comparison bit masks, null means 'always false', see constants in IndexCondition
masks
,
TableFilter[]
all joined table filters
filters
,
int
the current table filter index
filter
,
SortOrder
the sort order
sortOrder
,
AllColumnsForPlan
the set of all columns
allColumnsSet
)

Implements abstract org.h2.index.Index.getCost.

Estimate the cost to search for rows given the search mask.

public String
getCreateSQL()

Overrides org.h2.index.Index.getCreateSQL.

Construct the CREATE ...

public long
getRowCount(SessionLocal
the session
session
)

Implements abstract org.h2.index.Index.getRowCount.

Get the row count of this table, for the given session.

public long
getRowCountApproximation(SessionLocal
the session
session
)

Implements abstract org.h2.index.Index.getRowCountApproximation.

Get the approximated row count for this table.

private static boolean
public boolean
needRebuild()

Implements abstract org.h2.index.Index.needRebuild.

Check if the index needs to be rebuilt.

public void
remove(SessionLocal
the session
session
)

Implements abstract org.h2.index.Index.remove.

Remove the index.

public void
remove(SessionLocal
the session
session
,
Row
the row
row
)

Implements abstract org.h2.index.Index.remove.

Remove a row from the index.

public void
truncate(SessionLocal
the session
session
)

Implements abstract org.h2.index.Index.truncate.

Remove all rows from the index.

public void
update(Row
the old data
oldRow
,
Row
the new data
newRow
,
SessionLocal
the session
session
)

Update a row using a UPDATE statement.

Inherited from org.h2.index.Index:
canFindNextcanGetFirstOrLastcanScancheckIndexColumnTypescompareRowsfindFirstOrLastfindNextgetColumnIndexgetColumnsgetCostRangeIndexgetCreateSQLForCopygetDiskSpaceUsedgetDuplicateKeyExceptiongetDuplicatePrimaryKeyMessagegetIndexColumnsgetIndexTypegetPlanSQLgetRowgetRowFactorygetTablegetTypegetUniqueColumnCountgetUniqueRowFactoryisFindUsingFullTableScanisFirstColumnisRowIdIndexneedsUniqueCheckremoveChildrenAndResourcesupdate

Field Detail

rowCountback to summary
private long rowCount
sqlFlagsback to summary
private final int sqlFlags
targetTableNameback to summary
private final String targetTableName

Constructor Detail

Method Detail

addback to summary
public void add(SessionLocal session, Row row)

Implements abstract org.h2.index.Index.add.

Doc from org.h2.index.Index.add.

Add a row to the index.

Parameters
session:SessionLocal

the session to use

row:Row

the row to add

Annotations
@Override
addColumnNameback to summary
private void addColumnName(StringBuilder builder, Column col)
addParameterback to summary
private void addParameter(StringBuilder builder, Column col)
checkRenameback to summary
public void checkRename()

Overrides org.h2.engine.DbObject.checkRename.

Doc from org.h2.engine.DbObject.checkRename.

Check if renaming is allowed. Does nothing when allowed.

Annotations
@Override
closeback to summary
public void close(SessionLocal session)

Implements abstract org.h2.index.Index.close.

Doc from org.h2.index.Index.close.

Close this index.

Parameters
session:SessionLocal

the session used to write data

Annotations
@Override
findback to summary
public Cursor find(SessionLocal session, SearchRow first, SearchRow last, boolean reverse)

Implements abstract org.h2.index.Index.find.

Doc from org.h2.index.Index.find.

Find a row or a list of rows and create a cursor to iterate over the result.

Parameters
session:SessionLocal

the session

first:SearchRow

the first row, or null for no limit

last:SearchRow

the last row, or null for no limit

reverse:boolean

if true, iterate in reverse (descending) order

Returns:Cursor

the cursor to iterate over the results

Annotations
@Override
getCostback to summary
public double getCost(SessionLocal session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, AllColumnsForPlan allColumnsSet)

Implements abstract org.h2.index.Index.getCost.

Doc from org.h2.index.Index.getCost.

Estimate the cost to search for rows given the search mask. There is one element per column in the search mask. For possible search masks, see IndexCondition.

Parameters
session:SessionLocal

the session

masks:int[]

per-column comparison bit masks, null means 'always false', see constants in IndexCondition

filters:TableFilter[]

all joined table filters

filter:int

the current table filter index

sortOrder:SortOrder

the sort order

allColumnsSet:AllColumnsForPlan

the set of all columns

Returns:double

the estimated cost

Annotations
@Override
getCreateSQLback to summary
public String getCreateSQL()

Overrides org.h2.index.Index.getCreateSQL.

Doc from org.h2.engine.DbObject.getCreateSQL.

Construct the CREATE ... SQL statement for this object.

Returns:String

the SQL statement

Annotations
@Override
getRowCountback to summary
public long getRowCount(SessionLocal session)

Implements abstract org.h2.index.Index.getRowCount.

Doc from org.h2.index.Index.getRowCount.

Get the row count of this table, for the given session.

Parameters
session:SessionLocal

the session

Returns:long

the row count

Annotations
@Override
getRowCountApproximationback to summary
public long getRowCountApproximation(SessionLocal session)

Implements abstract org.h2.index.Index.getRowCountApproximation.

Doc from org.h2.index.Index.getRowCountApproximation.

Get the approximated row count for this table.

Parameters
session:SessionLocal

the session

Returns:long

the approximated row count

Annotations
@Override
isNullback to summary
private static boolean isNull(Value v)
needRebuildback to summary
public boolean needRebuild()

Implements abstract org.h2.index.Index.needRebuild.

Doc from org.h2.index.Index.needRebuild.

Check if the index needs to be rebuilt. This method is called after opening an index.

Returns:boolean

true if a rebuild is required.

Annotations
@Override
removeback to summary
public void remove(SessionLocal session)

Implements abstract org.h2.index.Index.remove.

Doc from org.h2.index.Index.remove.

Remove the index.

Parameters
session:SessionLocal

the session

Annotations
@Override
removeback to summary
public void remove(SessionLocal session, Row row)

Implements abstract org.h2.index.Index.remove.

Doc from org.h2.index.Index.remove.

Remove a row from the index.

Parameters
session:SessionLocal

the session

row:Row

the row

Annotations
@Override
truncateback to summary
public void truncate(SessionLocal session)

Implements abstract org.h2.index.Index.truncate.

Doc from org.h2.index.Index.truncate.

Remove all rows from the index.

Parameters
session:SessionLocal

the session

Annotations
@Override
updateback to summary
public void update(Row oldRow, Row newRow, SessionLocal session)

Update a row using a UPDATE statement. This method is to be called if the emit updates option is enabled.

Parameters
oldRow:Row

the old data

newRow:Row

the new data

session:SessionLocal

the session