Class IndexStatistics
One index as the database catalog sees it. Honestly nullable: each provider fills what
its engine can report (PostgreSQL and MSSQL carry usage counters, SQLite does not;
MSSQL usage counters reset on server restart; needs PostgreSQL 16+).
public class IndexStatistics
Inheritance
Properties
BacksForeignKey
The index serves a foreign key, so dropping it turns key checks into scans.
public bool BacksForeignKey { get; set; }
Columns
Key columns in index order. Empty only when the engine could not report them.
public IReadOnlyList<string> Columns { get; set; }
EstimatedRows
Planner's row estimate for the index; null when unavailable.
public long? EstimatedRows { get; set; }
IncludedColumns
Columns carried but not keyed (MSSQL INCLUDE); empty elsewhere. Without this a
public IReadOnlyList<string> IncludedColumns { get; set; }
IsClustered
MSSQL clustered index - the table itself; null on engines without the notion.
public bool? IsClustered { get; set; }
IsRedbOwned
The index belongs to a table of the redb schema (a name starting with '_').
public bool IsRedbOwned { get; set; }
IsSystemCritical
The index must not be dropped, whatever its usage counters say (owner decision
public bool IsSystemCritical { get; set; }
IsUnique
Whether the index is unique; null when the catalog does not say.
public bool? IsUnique { get; set; }
IsUniqueConstraint
The index backs a unique constraint (as opposed to a plain unique index).
public bool IsUniqueConstraint { get; set; }
LastUsed
Last time the index served a read; PostgreSQL 16+ and MSSQL only.
public DateTimeOffset? LastUsed { get; set; }
Scans
Range/full scans (MSSQL); null where the engine does not split the counter.
public long? Scans { get; set; }
Schema
Schema of the table; null on engines without schemas (SQLite).
public string? Schema { get; set; }
Seeks
Point-lookup uses. PostgreSQL reports one combined scan counter here.
public long? Seeks { get; set; }
SizeBytes
On-disk size in bytes; null when unavailable (SQLite without dbstat).
public long? SizeBytes { get; set; }