public class MVSpatialIndex extends MVIndex<Spatial,Value> implements SpatialIndex
columnIds, columns, indexColumns, indexType, table, 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 |
|---|
MVSpatialIndex(Database db,
MVTable table,
int id,
java.lang.String indexName,
IndexColumn[] columns,
int uniqueColumnCount,
IndexType indexType)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(SessionLocal session,
Row row)
Add a row to the index.
|
void |
addBufferedRows(java.util.List<java.lang.String> bufferNames)
Add all the index data from the buffers to the index.
|
void |
addRowsToBuffer(java.util.List<Row> rows,
java.lang.String bufferName)
Add the rows to a temporary storage (not to the index yet).
|
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.
|
Value |
getBounds(SessionLocal session)
Returns the minimum bounding box that encloses all keys.
|
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.
|
static long |
getCostRangeIndex(int[] masks,
Column[] columns)
Compute spatial index cost
|
long |
getDiskSpaceUsed()
Get the used disk space for this index.
|
Value |
getEstimatedBounds(SessionLocal session)
Returns the estimated minimum bounding box that encloses all keys.
|
MVMap<Spatial,VersionedValue<Value>> |
getMVMap() |
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.
|
MVTable |
getTable()
Get the table on which this index is based.
|
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.
|
canFindNext, canGetFirstOrLast, canScan, checkIndexColumnTypes, compareRows, findFirstOrLast, findNext, getColumnIndex, getColumns, getCostRangeIndex, getCreateSQL, getCreateSQLForCopy, getDuplicateKeyException, getDuplicatePrimaryKeyMessage, getIndexColumns, getIndexType, getPlanSQL, getRow, getRowFactory, getType, getUniqueColumnCount, getUniqueRowFactory, isFindUsingFullTableScan, isFirstColumn, isHidden, isRowIdIndex, needsUniqueCheck, removeChildrenAndResources, updategetSchema, getSQL, getSQLcheckRename, getChildren, 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 MVSpatialIndex(Database db, MVTable table, int id, java.lang.String indexName, IndexColumn[] columns, int uniqueColumnCount, IndexType indexType)
db - the databasetable - the table instanceid - the index idindexName - the index namecolumns - the indexed columns (only one geometry column allowed)uniqueColumnCount - count of unique columns (0 or 1)indexType - the index type (only spatial index)public void addRowsToBuffer(java.util.List<Row> rows, java.lang.String bufferName)
MVIndexaddRowsToBuffer in class MVIndex<Spatial,Value>rows - the rowsbufferName - the name of the temporary storagepublic void addBufferedRows(java.util.List<java.lang.String> bufferNames)
MVIndexaddBufferedRows in class MVIndex<Spatial,Value>bufferNames - the names of the temporary storagepublic void close(SessionLocal session)
Indexpublic void add(SessionLocal session, Row row)
Indexpublic void remove(SessionLocal session, Row row)
Indexpublic 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 Value getBounds(SessionLocal session)
session - the sessionpublic Value getEstimatedBounds(SessionLocal session)
session - the sessionpublic MVTable getTable()
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 static long getCostRangeIndex(int[] masks,
Column[] columns)
masks - Search maskcolumns - Table columnspublic void remove(SessionLocal session)
Indexpublic void truncate(SessionLocal session)
Indexpublic boolean needRebuild()
IndexneedRebuild in class Indexpublic long getRowCount(SessionLocal session)
IndexgetRowCount in class Indexsession - the sessionpublic long getRowCountApproximation(SessionLocal session)
IndexgetRowCountApproximation in class Indexsession - the sessionpublic long getDiskSpaceUsed()
IndexgetDiskSpaceUsed in class Index