org.hsqldb.index
Interface Index
-
- All Superinterfaces:
- SchemaObject
- All Known Implementing Classes:
- IndexAVL, IndexAVLMemory
public interface Index extends SchemaObject
- Since:
- 1.9.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface and Description static classIndex.IndexUse-
Nested classes/interfaces inherited from interface org.hsqldb.SchemaObject
SchemaObject.ConstraintTypes, SchemaObject.Deferable, SchemaObject.Nullability, SchemaObject.ParameterModes, SchemaObject.ReferentialAction, SchemaObject.ViewCheckModes
-
-
Field Summary
Fields Modifier and Type Field and Description static doublecachedFactorstatic Index[]emptyArraystatic Index.IndexUse[]emptyUseArraystatic intINDEX_NON_UNIQUEstatic intINDEX_NONEstatic intINDEX_UNIQUEstatic doubleminimumSelectivitystatic intprobeDepth-
Fields inherited from interface org.hsqldb.SchemaObject
ASSERTION, CATALOG, CHARSET, COLLATION, COLUMN, CONSTRAINT, CURSOR, DOMAIN, FUNCTION, GRANTEE, INDEX, LABEL, PARAMETER, PROCEDURE, ROUTINE, SCHEMA, SEARCH, SEQUENCE, SERVER, SPECIFIC_ROUTINE, SUBQUERY, TABLE, TRANSITION, TRIGGER, TYPE, VARIABLE, VIEW, WRAPPER
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Index.IndexUse[]asArray()voidcheckIndex(PersistentStore store)intcompareRow(Session session, java.lang.Object[] a, java.lang.Object[] b)intcompareRowNonUnique(Session session, java.lang.Object[] a, java.lang.Object[] b, int fieldcount)As above but use the index column dataintcompareRowNonUnique(Session session, java.lang.Object[] a, java.lang.Object[] b, int[] rowColMap)Compares two table rows based on the columns of this index.intcompareRowNonUnique(Session session, java.lang.Object[] a, java.lang.Object[] b, int[] rowColMap, int fieldCount)voiddelete(Session session, PersistentStore store, Row row)RowIteratoremptyIterator()booleanexistsParent(Session session, PersistentStore store, java.lang.Object[] rowdata, int[] rowColMap)RowIteratorfindFirstRow(Session session, PersistentStore store, java.lang.Object[] rowdata)Return the first node equal to the rowdata object.RowIteratorfindFirstRow(Session session, PersistentStore store, java.lang.Object[] rowdata, int[] rowColMap)Return the first node equal to the rowdata object.RowIteratorfindFirstRow(Session session, PersistentStore store, java.lang.Object[] rowdata, int matchCount, int distinctCount, int compareType, boolean reversed, boolean[] map)Return the first node equal to the indexdata object.RowIteratorfindFirstRowNotNull(Session session, PersistentStore store)Finds the first node where the data is not null.RowIteratorfirstRow(PersistentStore store)RowIteratorfirstRow(Session session, PersistentStore store, int distinctCount)Returns the row for the first node of the indexintgetColumnCount()Returns the count of visible columns usedboolean[]getColumnDesc()Returns the count of visible columns usedint[]getColumns()Returns the array containing column indexes for indexType[]getColumnTypes()Returns the array containing column indexes for indexint[]getDefaultColumnMap()Returns the array containing 0, 1, ..intgetIndexOrderValue()Returns a value indicating the order of different types of index in the list of indexes for a table.longgetPersistenceId()intgetPosition()voidinsert(Session session, PersistentStore store, Row row)Insert a node into the indexbooleanisClustered()booleanisConstraint()Does this index belong to a constraint?booleanisEmpty(PersistentStore store)booleanisForward()booleanisUnique()Is this a UNIQUE index?RowIteratorlastRow(Session session, PersistentStore store, int distinctCount)Returns the row for the last node of the indexdouble[]searchCost(Session session, PersistentStore store)voidsetClustered(boolean clustered)voidsetPosition(int position)voidsetTable(TableBase table)longsize(Session session, PersistentStore store)Returns the node count.longsizeUnique(PersistentStore store)-
Methods inherited from interface org.hsqldb.SchemaObject
compile, getCatalogName, getChangeTimestamp, getComponents, getName, getOwner, getReferences, getSchemaName, getSQL, getType
-
-
-
-
Field Detail
-
INDEX_NONE
static final int INDEX_NONE
- See Also:
- Constant Field Values
-
INDEX_NON_UNIQUE
static final int INDEX_NON_UNIQUE
- See Also:
- Constant Field Values
-
INDEX_UNIQUE
static final int INDEX_UNIQUE
- See Also:
- Constant Field Values
-
minimumSelectivity
static final double minimumSelectivity
- See Also:
- Constant Field Values
-
cachedFactor
static final double cachedFactor
- See Also:
- Constant Field Values
-
probeDepth
static final int probeDepth
- See Also:
- Constant Field Values
-
emptyArray
static final Index[] emptyArray
-
emptyUseArray
static final Index.IndexUse[] emptyUseArray
-
-
Method Detail
-
asArray
Index.IndexUse[] asArray()
-
emptyIterator
RowIterator emptyIterator()
-
getPosition
int getPosition()
-
setPosition
void setPosition(int position)
-
getPersistenceId
long getPersistenceId()
-
getColumnCount
int getColumnCount()
Returns the count of visible columns used
-
isUnique
boolean isUnique()
Is this a UNIQUE index?
-
isConstraint
boolean isConstraint()
Does this index belong to a constraint?
-
getColumns
int[] getColumns()
Returns the array containing column indexes for index
-
getColumnTypes
Type[] getColumnTypes()
Returns the array containing column indexes for index
-
getColumnDesc
boolean[] getColumnDesc()
Returns the count of visible columns used
-
getDefaultColumnMap
int[] getDefaultColumnMap()
Returns the array containing 0, 1, .. column indexes
-
getIndexOrderValue
int getIndexOrderValue()
Returns a value indicating the order of different types of index in the list of indexes for a table. The position of the groups of Indexes in the list in ascending order is as follows: primary key index unique constraint indexes autogenerated foreign key indexes for FK's that reference this table or tables created before this table user created indexes (CREATE INDEX) autogenerated foreign key indexes for FK's that reference tables created after this table Among a group of indexes, the order is based on the order of creation of the index.- Returns:
- ordinal value
-
isForward
boolean isForward()
-
setTable
void setTable(TableBase table)
-
setClustered
void setClustered(boolean clustered)
-
isClustered
boolean isClustered()
-
size
long size(Session session, PersistentStore store)
Returns the node count.
-
sizeUnique
long sizeUnique(PersistentStore store)
-
searchCost
double[] searchCost(Session session, PersistentStore store)
-
isEmpty
boolean isEmpty(PersistentStore store)
-
checkIndex
void checkIndex(PersistentStore store)
-
insert
void insert(Session session, PersistentStore store, Row row)
Insert a node into the index
-
delete
void delete(Session session, PersistentStore store, Row row)
-
existsParent
boolean existsParent(Session session, PersistentStore store, java.lang.Object[] rowdata, int[] rowColMap)
-
findFirstRow
RowIterator findFirstRow(Session session, PersistentStore store, java.lang.Object[] rowdata, int matchCount, int distinctCount, int compareType, boolean reversed, boolean[] map)
Return the first node equal to the indexdata object. The rowdata has the same column mapping as this index.- Parameters:
session- session objectstore- store objectcoldata- array containing index column datamatch- count of columns to match- Returns:
- iterator
-
findFirstRow
RowIterator findFirstRow(Session session, PersistentStore store, java.lang.Object[] rowdata)
Return the first node equal to the rowdata object. The rowdata has the same column mapping as this table.- Parameters:
session- session objectstore- store objectrowdata- array containing table row data- Returns:
- iterator
-
findFirstRow
RowIterator findFirstRow(Session session, PersistentStore store, java.lang.Object[] rowdata, int[] rowColMap)
Return the first node equal to the rowdata object. The rowdata has the column mapping privided in rowColMap.- Parameters:
session- session objectstore- store objectrowdata- array containing table row data- Returns:
- iterator
-
findFirstRowNotNull
RowIterator findFirstRowNotNull(Session session, PersistentStore store)
Finds the first node where the data is not null.- Returns:
- iterator
-
firstRow
RowIterator firstRow(PersistentStore store)
-
firstRow
RowIterator firstRow(Session session, PersistentStore store, int distinctCount)
Returns the row for the first node of the index- Returns:
- Iterator for first row
-
lastRow
RowIterator lastRow(Session session, PersistentStore store, int distinctCount)
Returns the row for the last node of the index- Returns:
- last row
-
compareRowNonUnique
int compareRowNonUnique(Session session, java.lang.Object[] a, java.lang.Object[] b, int[] rowColMap)
Compares two table rows based on the columns of this index. The rowColMap parameter specifies which columns of the other table are to be compared with the colIndex columns of this index. The rowColMap can cover all or only some columns of this index.- Parameters:
a- row from another tablerowColMap- column indexes in the other tableb- a full row in this table- Returns:
- comparison result, -1,0,+1
-
compareRowNonUnique
int compareRowNonUnique(Session session, java.lang.Object[] a, java.lang.Object[] b, int[] rowColMap, int fieldCount)
-
compareRowNonUnique
int compareRowNonUnique(Session session, java.lang.Object[] a, java.lang.Object[] b, int fieldcount)
As above but use the index column data
-
compareRow
int compareRow(Session session, java.lang.Object[] a, java.lang.Object[] b)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG