Top Inners Fields Methods
org.hsqldb.index

public Interface Index

extends SchemaObject
Known Direct Implementers
org.hsqldb.index.IndexAVL
Imports
org.hsqldb.RangeVariable.RangeVariableConditions, .Row, .SchemaObject, .Session, .TableBase, org.hsqldb.navigator.RowIterator, org.hsqldb.persist.PersistentStore, org.hsqldb.types.Type

Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.9.0
Version
2.5.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
public static final double
public static final Index[]
public static final Index.IndexUse[]
public static final int
public static final int
public static final int
public static final double
public static final int
Inherited from org.hsqldb.SchemaObject:
ASSERTIONCATALOGCHARSETCOLLATIONCOLUMNCONSTRAINTCURSORDATABASEDOMAINEXCEPTIONFUNCTIONGRANTEEINDEXLABELMODULEPARAMETERPERIODPROCEDUREREFERENCEROUTINESCHEMASEARCHSEQUENCESERVERSPECIFIC_ROUTINESUBQUERYTABLETRANSITIONTRIGGERTYPEVARIABLEVIEWWRAPPER

Method Summary

Modifier and TypeMethod and Description
public Index.IndexUse[]
public int
compareRow(Session session, Object[] a, Object[] b)

public int

Returns:

comparison result, -1,0,+1
compareRowNonUnique
(Session
Session
session
,
Object[]
row from another table
a
,
Object[]
a full row in this table
b
,
int[]
column indexes in the other table
rowColMap
)

Compares two table rows based on the columns of this index.

public int
compareRowNonUnique(Session session, Object[] a, Object[] b, int[] rowColMap, int fieldCount)

public int
compareRowNonUnique(Session session, Object[] a, Object[] b, int fieldcount)

As above but use the index column data

public void
delete(Session session, PersistentStore store, Row row)

public boolean
existsParent(Session session, PersistentStore store, Object[] rowdata, int[] rowColMap)

public RowIterator

Returns:

iterator
findFirstRow
(Session
session object
session
,
PersistentStore
store object
store
,
Object[]
Object[]
rowdata
,
int
count of columns to match
matchCount
,
int
int
distinctCount
,
int
int
compareType
,
boolean
boolean
reversed
,
boolean[]
boolean[]
map
)

Return the first node equal to the indexdata object.

public RowIterator

Returns:

iterator
findFirstRow
(Session
session object
session
,
PersistentStore
store object
store
,
Object[]
array containing table row data
rowdata
)

Return the first node equal to the rowdata object.

public RowIterator

Returns:

iterator
findFirstRow
(Session
session object
session
,
PersistentStore
store object
store
,
Object[]
array containing table row data
rowdata
,
int[]
int[]
rowColMap
)

Return the first node equal to the rowdata object.

public RowIterator

Returns:

iterator
findFirstRowNotNull
(Session
Session
session
,
PersistentStore
PersistentStore
store
)

Finds the first node where the data is not null.

public RowIterator
public RowIterator

Returns:

Iterator for first row
firstRow
(Session session, PersistentStore store, RangeVariable.RangeVariableConditions[] conditions, int distinctCount, boolean[] map)

Returns the row for the first node of the index

public int
getColumnCount()

Returns the count of visible columns used

public boolean[]

Returns:

boolean[]
getColumnDesc
()

Returns the array containing desc column flags

public int[]

Returns:

int[]
getColumns
()

Returns the array containing column indexes for index

public Type[]

Returns:

Type[]
getColumnTypes
()

Returns the array containing column indexes for index

public int[]

Returns:

int[]
getDefaultColumnMap
()

Returns the array containing 0, 1, ...

public int

Returns:

ordinal value
getIndexOrderValue
()

Returns a value indicating the order of different types of index in the list of indexes for a table.

public long
public int
public TableBase
public void
insert(Session session, PersistentStore store, Row row)

Insert a node into the index

public boolean
public boolean
isConstraint()

Does this index belong to a constraint?

public boolean
public boolean
public boolean
isPrimaryKey()

Is this a PRIMARY_KEY index?

public boolean
isUnique()

Is this a UNIQUE index?

public RowIterator

Returns:

Iterator from last row
lastRow
(Session
Session
session
,
PersistentStore
PersistentStore
store
,
int
int
distinctCount
,
boolean[]
boolean[]
usedColumnCheck
)

Returns the row for the last node of the index

public double[]
public void
setClustered(boolean clustered)

public void
setPosition(int position)

public void
public long
size(Session session, PersistentStore store)

Returns the node count.

public long
Inherited from org.hsqldb.SchemaObject:
compilegetCatalogNamegetChangeTimestampgetComponentsgetNamegetOwnergetReferencesgetSchemaNamegetSQLgetType

Field Detail

cachedFactorback to summary
public static final double cachedFactor
emptyArrayback to summary
public static final Index[] emptyArray

Hides org.hsqldb.SchemaObject.emptyArray.

emptyUseArrayback to summary
public static final Index.IndexUse[] emptyUseArray
INDEX_NON_UNIQUEback to summary
public static final int INDEX_NON_UNIQUE
INDEX_NONEback to summary
public static final int INDEX_NONE
INDEX_UNIQUEback to summary
public static final int INDEX_UNIQUE
minimumSelectivityback to summary
public static final double minimumSelectivity
probeDepthback to summary
public static final int probeDepth

Method Detail

asArrayback to summary
public Index.IndexUse[] asArray()
compareRowback to summary
public int compareRow(Session session, Object[] a, Object[] b)
compareRowNonUniqueback to summary
public int compareRowNonUnique(Session session, Object[] a, 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
session:Session

Session

a:Object[]

row from another table

b:Object[]

a full row in this table

rowColMap:int[]

column indexes in the other table

Returns:int

comparison result, -1,0,+1

compareRowNonUniqueback to summary
public int compareRowNonUnique(Session session, Object[] a, Object[] b, int[] rowColMap, int fieldCount)
compareRowNonUniqueback to summary
public int compareRowNonUnique(Session session, Object[] a, Object[] b, int fieldcount)

As above but use the index column data

deleteback to summary
public void delete(Session session, PersistentStore store, Row row)
existsParentback to summary
public boolean existsParent(Session session, PersistentStore store, Object[] rowdata, int[] rowColMap)
findFirstRowback to summary
public RowIterator findFirstRow(Session session, PersistentStore store, 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

session object

store:PersistentStore

store object

rowdata:Object[]

Object[]

matchCount:int

count of columns to match

distinctCount:int

int

compareType:int

int

reversed:boolean

boolean

map:boolean[]

boolean[]

Returns:RowIterator

iterator

findFirstRowback to summary
public RowIterator findFirstRow(Session session, PersistentStore store, Object[] rowdata)

Return the first node equal to the rowdata object. The rowdata has the same column mapping as this table.

Parameters
session:Session

session object

store:PersistentStore

store object

rowdata:Object[]

array containing table row data

Returns:RowIterator

iterator

findFirstRowback to summary
public RowIterator findFirstRow(Session session, PersistentStore store, Object[] rowdata, int[] rowColMap)

Return the first node equal to the rowdata object. The rowdata has the column mapping provided in rowColMap.

Parameters
session:Session

session object

store:PersistentStore

store object

rowdata:Object[]

array containing table row data

rowColMap:int[]

int[]

Returns:RowIterator

iterator

findFirstRowNotNullback to summary
public RowIterator findFirstRowNotNull(Session session, PersistentStore store)

Finds the first node where the data is not null.

Parameters
session:Session

Session

store:PersistentStore

PersistentStore

Returns:RowIterator

iterator

firstRowback to summary
public RowIterator firstRow(PersistentStore store)
firstRowback to summary
public RowIterator firstRow(Session session, PersistentStore store, RangeVariable.RangeVariableConditions[] conditions, int distinctCount, boolean[] map)

Returns the row for the first node of the index

Returns:RowIterator

Iterator for first row

getColumnCountback to summary
public int getColumnCount()

Returns the count of visible columns used

getColumnDescback to summary
public boolean[] getColumnDesc()

Returns the array containing desc column flags

Returns:boolean[]

boolean[]

getColumnsback to summary
public int[] getColumns()

Returns the array containing column indexes for index

Returns:int[]

int[]

getColumnTypesback to summary
public Type[] getColumnTypes()

Returns the array containing column indexes for index

Returns:Type[]

Type[]

getDefaultColumnMapback to summary
public int[] getDefaultColumnMap()

Returns the array containing 0, 1, ... column indexes

Returns:int[]

int[]

getIndexOrderValueback to summary
public 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:int

ordinal value

getPersistenceIdback to summary
public long getPersistenceId()
getPositionback to summary
public int getPosition()
getTableback to summary
public TableBase getTable()
insertback to summary
public void insert(Session session, PersistentStore store, Row row)

Insert a node into the index

isClusteredback to summary
public boolean isClustered()
isConstraintback to summary
public boolean isConstraint()

Does this index belong to a constraint?

isEmptyback to summary
public boolean isEmpty(PersistentStore store)
isForwardback to summary
public boolean isForward()
isPrimaryKeyback to summary
public boolean isPrimaryKey()

Is this a PRIMARY_KEY index?

isUniqueback to summary
public boolean isUnique()

Is this a UNIQUE index?

lastRowback to summary
public RowIterator lastRow(Session session, PersistentStore store, int distinctCount, boolean[] usedColumnCheck)

Returns the row for the last node of the index

Parameters
session:Session

Session

store:PersistentStore

PersistentStore

distinctCount:int

int

usedColumnCheck:boolean[]

boolean[]

Returns:RowIterator

Iterator from last row

searchCostback to summary
public double[] searchCost(Session session, PersistentStore store)
setClusteredback to summary
public void setClustered(boolean clustered)
setPositionback to summary
public void setPosition(int position)
setTableback to summary
public void setTable(TableBase table)
sizeback to summary
public long size(Session session, PersistentStore store)

Returns the node count.

sizeUniqueback to summary
public long sizeUnique(PersistentStore store)
org.hsqldb.index back to summary

public Class Index.IndexUse

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
public int
public Index

Constructor Summary

AccessConstructor and Description
public
IndexUse(Index index, int columnCount)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

columnCountback to summary
public int columnCount
indexback to summary
public Index index

Constructor Detail

IndexUseback to summary
public IndexUse(Index index, int columnCount)