Package org.h2.index

# Class QueryExpressionIndex

java.lang.Object
org.h2.engine.DbObject
org.h2.schema.SchemaObject
org.h2.index.Index
org.h2.index.QueryExpressionIndex

All Implemented Interfaces:
  `HasSQL`

Direct Known Subclasses:
  `RecursiveIndex`, `RegularQueryExpressionIndex`

public abstract class QueryExpressionIndex extends Index
This object represents a virtual index for a query expression.

## Field Summary

### Fields inherited from class org.h2.index.Index

`columnIds, columns, indexColumns, indexType, uniqueColumnColumn`

### Fields inherited from class org.h2.engine.DbObject

`AGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USER`

### Fields inherited from interface org.h2.util.HasSQL

`ADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS`

## Method Summary

Modifier and Type
Method
Description
`void`
`add(SessionLocal session, Row row)`
Add a row to the index.
`void`
`checkRename()`
Check if renaming is allowed.
`void`
`close(SessionLocal session)`
Close this index.
`String`
`getPlanSQL()`
Get the message to show in a EXPLAIN statement.
`Query`
`getQuery()`
`long`
`getRowCount(SessionLocal session)`
Get the row count of this table, for the given session.
`long`
`getRowCountApproximation(SessionLocal session)`
Get the approximated row count for this table.
`abstract boolean`
`isExpired()`
`boolean`
`needRebuild()`
Check if the index needs to be rebuilt.
`void`
`remove(SessionLocal session)`
Remove the index.
`void`
`remove(SessionLocal session, Row row)`
Remove a row from the index.
`void`
`truncate(SessionLocal session)`
Remove all rows from the index.

### Methods inherited from class org.h2.index.Index

`canFindNext, canGetFirstOrLast, canScan, checkIndexColumnTypes, compareRows, find, findFirstOrLast, findNext, getColumnIndex, getColumns, getCost, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDiskSpaceUsed, getDuplicateKeyException, getDuplicatePrimaryKeyMessage, getIndexColumns, getIndexType, getRow, getRowFactory, getTable, getType, getUniqueColumnCount, getUniqueRowFactory, isFindUsingFullTableScan, isFirstColumn, isRowIdIndex, needsUniqueCheck, removeChildrenAndResources, update`

### Methods inherited from class org.h2.schema.SchemaObject

`getSchema, getSQL, getSQL`

### Methods inherited from class org.h2.engine.DbObject

`equals, getChildren, getComment, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, hashCode, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.h2.util.HasSQL

`getTraceSQL`

## Method Details

### isExpired

public abstract boolean isExpired()

### getPlanSQL

public String getPlanSQL()
Description copied from class: `Index`
Get the message to show in a EXPLAIN statement.

Overrides:
  `getPlanSQL` in class `Index`
Returns:
  the plan

### getQuery

public Query getQuery()

### close

public void close(SessionLocal session)
Description copied from class: `Index`
Close this index.

Specified by:
  `close` in class `Index`
Parameters:
  `session` - the session used to write data

### add

public void add(SessionLocal session, Row row)
Description copied from class: `Index`
Add a row to the index.

Specified by:
  `add` in class `Index`
Parameters:
  `session` - the session to use
  `row` - the row to add

### remove

public void remove(SessionLocal session, Row row)
Description copied from class: `Index`
Remove a row from the index.

Specified by:
  `remove` in class `Index`
Parameters:
  `session` - the session
  `row` - the row

### remove

public void remove(SessionLocal session)
Description copied from class: `Index`
Remove the index.

Specified by:
  `remove` in class `Index`
Parameters:
  `session` - the session

### truncate

public void truncate(SessionLocal session)
Description copied from class: `Index`
Remove all rows from the index.

Specified by:
  `truncate` in class `Index`
Parameters:
  `session` - the session

### checkRename

public void checkRename()
Description copied from class: `DbObject`
Check if renaming is allowed. Does nothing when allowed.

Overrides:
  `checkRename` in class `DbObject`

### needRebuild

public boolean needRebuild()
Description copied from class: `Index`
Check if the index needs to be rebuilt. This method is called after opening an index.

Specified by:
  `needRebuild` in class `Index`
Returns:
  true if a rebuild is required.

### getRowCount

public long getRowCount(SessionLocal session)
Description copied from class: `Index`
Get the row count of this table, for the given session.

Specified by:
  `getRowCount` in class `Index`
Parameters:
  `session` - the session
Returns:
  the row count

### getRowCountApproximation

public long getRowCountApproximation(SessionLocal session)
Description copied from class: `Index`
Get the approximated row count for this table.

Specified by:
  `getRowCountApproximation` in class `Index`
Parameters:
  `session` - the session
Returns:
  the approximated row count