Package org.basex.query.util.index
Class IndexInfo
java.lang.Object
org.basex.query.util.index.IndexInfo
This class contains methods for storing information on new index expressions.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal CompileContextCompilation context.Costs of index access (null) if no index access is possible).final IndexDbIndex database.Index expression.Optimization info.final StepStep with predicate that can be rewritten for index access.Name test of parent element. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncosts(Data data, IndexSearch search) Computes costs if the specified data reference exists.booleanTries to rewrite the specified input for index access.voidCreates an index expression with an inverted axis path.booleanenforce()Indicates if the index rewriting should be enforced.Checks if the specified expression can be rewritten for index access, and returns the applicable index type.
-
Field Details
-
cc
Compilation context. -
db
Index database. -
step
Step with predicate that can be rewritten for index access. -
optInfo
Optimization info. -
test
Name test of parent element. -
expr
Index expression. -
costs
Costs of index access (null) if no index access is possible).
-
-
Constructor Details
-
IndexInfo
Constructor.- Parameters:
db- index databasecc- compilation contextstep- step containing the rewritable predicate
-
-
Method Details
-
type
Checks if the specified expression can be rewritten for index access, and returns the applicable index type.- Parameters:
input- input (ifnull, no optimization will be possible)type- index type, predefined by the called expression (can benull)- Returns:
- supplied type,
IndexType.TEXT,IndexType.ATTRIBUTE, ornullif index access is not possible
-
create
public boolean create(Expr search, IndexType type, boolean trim, InputInfo ii) throws QueryException Tries to rewrite the specified input for index access.- Parameters:
search- expression to find (can benull)type- index type (can benull)trim- normalize second stringii- input info (can benull)- Returns:
- success flag
- Throws:
QueryException- query exception
-
create
Creates an index expression with an inverted axis path.- Parameters:
root- new root expressionparent- add parent stepopt- optimization infoii- input info- Throws:
QueryException- query exception
-
costs
Computes costs if the specified data reference exists.- Parameters:
data- data referencesearch- index search definition- Returns:
- costs costs, or
nullif index access is not possible
-
enforce
public boolean enforce()Indicates if the index rewriting should be enforced.- Returns:
- result of check
-