@Immutable public final class IndexPlan extends Object implements Comparable<IndexPlan>
Constructor and Description |
---|
IndexPlan(String name,
String workspaceName,
String providerName,
Collection<Constraint> constraints,
Collection<JoinCondition> joinConditions,
int costEstimate,
long cardinalityEstimate,
Float selectivityEstimate,
Map<String,Object> parameters) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(IndexPlan that) |
long |
getCardinalityEstimate()
Return an estimate of the number of nodes that will be returned by this index given the constraints.
|
Collection<Constraint> |
getConstraints()
Get the constraints that should be applied to this index if/when it is used.
|
int |
getCostEstimate()
Return an estimate of the cost of using the index for the query in question.
|
Collection<JoinCondition> |
getJoinConditions()
Get the join conditions that should be applied to this index if/when it is used.
|
String |
getName()
Get the name of this index.
|
Map<String,Object> |
getParameters()
Get the provider-specific parameters for this index usage.
|
String |
getProviderName()
The name of the provider that owns the index.
|
Float |
getSelectivityEstimate()
Get the estimate of the selectivity of this index for the query constraints.
|
String |
getWorkspaceName()
Get the name of the workspace to which this index applies.
|
boolean |
hasSelectivityEstimate()
Determine if there is a
selectivity estimate . |
String |
toString() |
public IndexPlan(String name, String workspaceName, String providerName, Collection<Constraint> constraints, Collection<JoinCondition> joinConditions, int costEstimate, long cardinalityEstimate, Float selectivityEstimate, Map<String,Object> parameters)
public long getCardinalityEstimate()
When possible, the actual cardinality should be used. However, since an accurate number is often expensive or impossible to
determine in the planning phase, the cardinality can instead represent a rough order of magnitude. A value of Long.MAX_VALUE
indicates that the cardinality is unknown.
Indexes with lower costs and lower cardinalities
will be favored over other indexes.
public int getCostEstimate()
IndexProvider
that owns the index
is in a remote process, then the cost estimate will need to take into account the cost of transmitting the request with the
criteria and the response with all of the node that meet the criteria of the index.
Indexes with lower costs and lower cardinalities
will be favored over other indexes.
public boolean hasSelectivityEstimate()
selectivity estimate
. This is equivalent to calling:
return getSelectivityEstimate() != null
public Float getSelectivityEstimate()
selectivity = cardinality / totalThus the selectivity (if known) will always be between 0 and 1.0, inclusive.
This method returns the estimated selectivity if it is know, or null if it is not known.
public String getName()
public String getWorkspaceName()
public String getProviderName()
public Collection<Constraint> getConstraints()
public Collection<JoinCondition> getJoinConditions()
public Map<String,Object> getParameters()
public int compareTo(IndexPlan that)
compareTo
in interface Comparable<IndexPlan>
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.