BaseIndex

Most index implementations extend the base index.

Methods
static void checkIndexColumnTypes(IndexColumn[] columns)
Check that the index columns are not CLOB or BLOB.
static void checkIndexColumnTypes(IndexColumn[] columns)
Check that the index columns are not CLOB or BLOB.
Parameters:
columns - the columns
boolean canFindNext()
boolean canFindNext()
boolean canScan()
boolean canScan()
void commit(int operation, Row row)
void commit(int operation, Row row)
int compareKeys(SearchRow rowData, SearchRow compare)
Compare the positions of two rows.
int compareKeys(SearchRow rowData, SearchRow compare)
Compare the positions of two rows.
Parameters:
rowData - the first row
compare - the second row
Returns:
0 if both rows are equal, -1 if the first row is smaller, otherwise 1
int compareRows(SearchRow rowData, SearchRow compare)
int compareRows(SearchRow rowData, SearchRow compare)
IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter)
IndexLookupBatch createLookupBatch(TableFilter[] filters, int filter)
Cursor find(TableFilter filter, SearchRow first, SearchRow last)
Cursor find(TableFilter filter, SearchRow first, SearchRow last)
Cursor findNext(Session session, SearchRow higherThan, SearchRow last)
Find a row or a list of rows that is larger and create a cursor to iterate over the result.
Cursor findNext(Session session, SearchRow higherThan, SearchRow last)
Find a row or a list of rows that is larger and create a cursor to iterate over the result. The base implementation doesn't support this feature.
Parameters:
session - the session
higherThan - the lower limit (excluding)
last - the last row, or null for no limit
Returns:
the cursor
Throws:
DbException - always
int getColumnIndex(Column col)
int getColumnIndex(Column col)
Column[] getColumns()
Column[] getColumns()
long getCostRangeIndex(int[] masks, long rowCount, TableFilter[] filters, int filter, SortOrder sortOrder, boolean isScanIndex, HashSet allColumnsSet)
Calculate the cost for the given mask as if this index was a typical b-tree range index.
long getCostRangeIndex(int[] masks, long rowCount, TableFilter[] filters, int filter, SortOrder sortOrder, boolean isScanIndex, HashSet allColumnsSet)
Calculate the cost for the given mask as if this index was a typical b-tree range index. This is the estimated cost required to search one row, and then iterate over the given number of rows.
Parameters:
masks - the IndexCondition search masks, one for each column in the table
rowCount - the number of rows in the index
filters - all joined table filters
filter - the current table filter index
sortOrder - the sort order
isScanIndex - whether this is a "table scan" index
allColumnsSet - the set of all columns
Returns:
the estimated cost
String getCreateSQL()
String getCreateSQL()
String getCreateSQLForCopy(Table targetTable, String quotedName)
String getCreateSQLForCopy(Table targetTable, String quotedName)
String getDropSQL()
String getDropSQL()
DbException getDuplicateKeyException(String key)
Create a duplicate key exception with a message that contains the index name.
DbException getDuplicateKeyException(String key)
Create a duplicate key exception with a message that contains the index name.
Parameters:
key - the key values
Returns:
the exception
IndexColumn[] getIndexColumns()
IndexColumn[] getIndexColumns()
IndexType getIndexType()
IndexType getIndexType()
String getPlanSQL()
String getPlanSQL()
Row getRow(Session session, long key)
Row getRow(Session session, long key)
Table getTable()
Table getTable()
int getType()
int getType()
void initBaseIndex(Table newTable, int id, String name, IndexColumn[] newIndexColumns, IndexType newIndexType)
Initialize the base index.
void initBaseIndex(Table newTable, int id, String name, IndexColumn[] newIndexColumns, IndexType newIndexType)
Initialize the base index.
Parameters:
newTable - the table
id - the object id
name - the index name
newIndexColumns - the columns that are indexed or null if this is not yet known
newIndexType - the index type
boolean isFindUsingFullTableScan()
boolean isFindUsingFullTableScan()
boolean isFirstColumn(Column column)
boolean isFirstColumn(Column column)
boolean isHidden()
boolean isHidden()
boolean isRowIdIndex()
boolean isRowIdIndex()
boolean mayHaveNullDuplicates(SearchRow searchRow)
Check if this row may have duplicates with the same indexed values in the current compatibility mode.
boolean mayHaveNullDuplicates(SearchRow searchRow)
Check if this row may have duplicates with the same indexed values in the current compatibility mode. Duplicates with {@code NULL} values are allowed in some modes.
Parameters:
searchRow - the row to check
Returns:
{@code true} if specified row may have duplicates, {@code false otherwise}
void removeChildrenAndResources(Session session)
void removeChildrenAndResources(Session session)
void setMultiVersion(boolean multiVersion)
void setMultiVersion(boolean multiVersion)
void setSortedInsertMode(boolean sortedInsertMode)
void setSortedInsertMode(boolean sortedInsertMode)