IndexStat
public struct IndexStat
A structure representing statistical information about an index.
This structure provides details about the total number of entries, the count of unique values, the distribution of values, and access-related metadata for an index.
- Properties:
- totalCount: The total number of entries in the index.
- uniqueValuesCount: The number of unique values in the index.
- valueDistribution: A dictionary mapping each unique value to its occurrence count.
- accessCount: The number of times the index has been accessed.
- lastAccess: The date and time when the index was last accessed.
-
Undocumented
Declaration
Swift
public var totalCount: Int
-
Undocumented
Declaration
Swift
public var uniqueValuesCount: Int
-
Undocumented
Declaration
Swift
public var valueDistribution: [AnyHashable : Int]
-
Undocumented
Declaration
Swift
public var accessCount: Int
-
Undocumented
Declaration
Swift
public var lastAccess: Date
-
The selectivity of the data, represented as a
Double
.Selectivity is a measure of how specific or filtered the data is, typically used in database query optimization to determine the efficiency of an index or query. A lower value indicates higher selectivity, meaning fewer rows match the criteria.
Declaration
Swift
public var selectivity: Double { get }
-
Estimates the number of elements within the specified range.
Declaration
Swift
public func estimateRange(lower: AnyHashable, upper: AnyHashable) -> Int
Parameters
lower
The lower bound of the range as an
AnyHashable
value.upper
The upper bound of the range as an
AnyHashable
value.Return Value
An integer representing the estimated count of elements within the range.