The cardinality estimate is an estimate of the number of nodes that will be returned by this index given the constraints. For example, an index that will return one node should have a cardinality of 1. 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.
The cost estimate is a measure of the expense of this index for the query in question. An index that is expensive to use will have a higher cost than another index that is less expensive to use. For example, if a {@link IndexProvider} that owns theindex 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.
@author Randall Hauch (rhauch@redhat.com)
|
|