public class QueryExpressionIndex extends Index implements SpatialIndex
columnIds, columns, indexColumns, indexType, uniqueColumnColumnAGGREGATE, comment, COMMENT, CONSTANT, CONSTRAINT, database, DOMAIN, FUNCTION_ALIAS, INDEX, RIGHT, ROLE, SCHEMA, SEQUENCE, SETTING, SYNONYM, TABLE_OR_VIEW, trace, TRIGGER, USERADD_PLAN_INFORMATION, DEFAULT_SQL_FLAGS, NO_CASTS, QUOTE_ONLY_WHEN_REQUIRED, REPLACE_LOBS_FOR_TRACE, TRACE_SQL_FLAGS| Constructor and Description |
|---|
QueryExpressionIndex(QueryExpressionTable table,
QueryExpressionIndex index,
SessionLocal session,
int[] masks,
TableFilter[] filters,
int filter,
SortOrder sortOrder)
Constructor for plan item generation.
|
QueryExpressionIndex(QueryExpressionTable table,
java.lang.String querySQL,
java.util.ArrayList<Parameter> originalParameters,
boolean recursive)
Constructor for the original index in
TableView. |
| Modifier and Type | Method and 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.
|
Cursor |
find(SessionLocal session,
SearchRow first,
SearchRow last)
Find a row or a list of rows and create a cursor to iterate over the
result.
|
Cursor |
findByGeometry(SessionLocal session,
SearchRow first,
SearchRow last,
SearchRow intersection)
Find a row or a list of rows and create a cursor to iterate over the
result.
|
double |
getCost(SessionLocal session,
int[] masks,
TableFilter[] filters,
int filter,
SortOrder sortOrder,
AllColumnsForPlan allColumnsSet)
Estimate the cost to search for rows given the search mask.
|
java.lang.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.
|
SessionLocal |
getSession() |
boolean |
isExpired() |
boolean |
isRecursive() |
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 |
setRecursive(boolean value) |
void |
setupQueryParameters(SessionLocal session,
SearchRow first,
SearchRow last,
SearchRow intersection)
Set the query parameters.
|
void |
truncate(SessionLocal session)
Remove all rows from the index.
|
canFindNext, canGetFirstOrLast, canScan, checkIndexColumnTypes, compareRows, findFirstOrLast, findNext, getColumnIndex, getColumns, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDiskSpaceUsed, getDuplicateKeyException, getDuplicatePrimaryKeyMessage, getIndexColumns, getIndexType, getRow, getRowFactory, getTable, getType, getUniqueColumnCount, getUniqueRowFactory, isFindUsingFullTableScan, isFirstColumn, isHidden, isRowIdIndex, mayHaveNullDuplicates, removeChildrenAndResources, updategetSchema, getSQL, getSQLgetChildren, getComment, getCreateSQLForMeta, getDatabase, getDropSQL, getId, getModificationId, getName, invalidate, isTemporary, isValid, rename, setComment, setModified, setObjectName, setTemporary, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetTraceSQLpublic QueryExpressionIndex(QueryExpressionTable table, java.lang.String querySQL, java.util.ArrayList<Parameter> originalParameters, boolean recursive)
TableView.table - the query expression tablequerySQL - the query SQLoriginalParameters - the original parametersrecursive - if the view is recursivepublic QueryExpressionIndex(QueryExpressionTable table, QueryExpressionIndex index, SessionLocal session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder)
table - the query expression tableindex - the main indexsession - the sessionmasks - the masksfilters - table filtersfilter - current filtersortOrder - sort orderpublic SessionLocal getSession()
public boolean isExpired()
public java.lang.String getPlanSQL()
IndexgetPlanSQL in class Indexpublic void close(SessionLocal session)
Indexpublic void add(SessionLocal session, Row row)
Indexpublic void remove(SessionLocal session, Row row)
Indexpublic double getCost(SessionLocal session, int[] masks, TableFilter[] filters, int filter, SortOrder sortOrder, AllColumnsForPlan allColumnsSet)
IndexgetCost in class Indexsession - the sessionmasks - per-column comparison bit masks, null means 'always false',
see constants in IndexConditionfilters - all joined table filtersfilter - the current table filter indexsortOrder - the sort orderallColumnsSet - the set of all columnspublic Cursor find(SessionLocal session, SearchRow first, SearchRow last)
Indexpublic Cursor findByGeometry(SessionLocal session, SearchRow first, SearchRow last, SearchRow intersection)
SpatialIndexfindByGeometry in interface SpatialIndexsession - the sessionfirst - the lower boundlast - the upper boundintersection - the geometry which values should intersect with, or
null for anythingpublic void setupQueryParameters(SessionLocal session, SearchRow first, SearchRow last, SearchRow intersection)
session - the sessionfirst - the lower boundlast - the upper boundintersection - the intersectionpublic Query getQuery()
public void remove(SessionLocal session)
Indexpublic void truncate(SessionLocal session)
Indexpublic void checkRename()
DbObjectcheckRename in class DbObjectpublic boolean needRebuild()
IndexneedRebuild in class Indexpublic void setRecursive(boolean value)
public long getRowCount(SessionLocal session)
IndexgetRowCount in class Indexsession - the sessionpublic long getRowCountApproximation(SessionLocal session)
IndexgetRowCountApproximation in class Indexsession - the sessionpublic boolean isRecursive()