Azavea.Open.DAO.Memory.SinglePropertyMemoryIndex.GetCardinality C# (CSharp) Method

GetCardinality() public method

Returns a number indicating how many breaks this index has for the properties used in the criteria. Roughly speaking, higher is better (though the number is an estimate, it is possible to have data that makes the index inefficient). If there are multiple indexes, the one that returns the highest number from this method will be used. An index should return 1 to indicate that it offers no value for this criteria.
public GetCardinality ( DaoCriteria crit ) : int
crit Azavea.Open.DAO.Criteria.DaoCriteria The query being run.
return int
        public override int GetCardinality(DaoCriteria crit)
        {
            // This is where it gets complicated.  Can you use this index, and
            // if so, how well?  Current implementation is extremely simplistic, it assumes
            // any ANDed expression is equally useable.
            return GetExpressionsForIndex(crit).Count > 0 ? _values.Count : 1;
        }