Skip to content

IndexInformation Class ​

Definition ​

Provides Index details for schema definition, discovery, and ops stats.

  • Namespace: JASE.Database
  • Assembly: JASE.Database.dll

Constructors ​

NameDescription
IndexInformation()Creates an empty index definition (for discovery / object initializers).

Properties ​

NameDescription
ColumnsList of IndexColumn entries about the indexes Columns
CommentOptional SQL comment / description for the index.
EstimatedRowsEstimated number of rows in the table
ExcludeNullsWhen , CREATE INDEX adds IS NOT NULL for each key column
FillFactorFill factor percentage for the index
FilterPredicateGets the optional filter predicate applied when creating a filtered or partial index.
FragmentationCurrent fragmentation percentage of the index
IncludeColumnsNon-key include / covering columns.
IndexTypeIndex type description
IsClusteredTrue when index is clustered
IsPrimaryKeyTrue for a tables Primary Key
IsSequentialKeyOptimizedTrue if the index is optimized for sequential key inserts
IsUniqueTrue if index requires a unique combination of values
IsValidTrue if the index is valid
LookUpsNumber of lookups using the index
NameIndex name
PagesNumber of pages allocated to the index
ScansNumber of index scans
SchemaSchema the index is contained within
SeeksNumber of index seeks
TableNameThe table indexed
UpdatesNumber of updates to the index

Methods ​

NameDescription
bool CommentEquals(IndexInformation other)Returns when this index and other have the same comment.
IndexInformation Copy()Creates a deep copy of this index definition (including stats when present).
IndexInformation Create(string name, string tableName, string schema, IEnumerable<string> columns, bool isUnique = null, bool isClustered = null, IEnumerable<string> includeColumns = null, string filterPredicate = null, int fillFactor = null, string comment = null, bool excludeNulls = null)Creates a schema-definition index (no runtime stats).
bool DefinitionsEqual(IndexInformation other, NamingStrategy namingStrategy)Returns when schema-definition fields match other (ignores runtime stats and index name).
string DropSql(IConnection connection)Generates an SQL statement to DROP the Index
string DropSql(ISqlGenerator generator)Generates an SQL statement to DROP the Index
int EstimateRebuildTime(DatabaseType type, int baseReferenceMinutes = null)Calcuates the estimated time in seconds to rebuild an index based on the database type
string GenerateDefaultName(string tableName, IEnumerable<string> columns)Returns a default index name for the given table and key columns.
string GetColumns()Returns comma separated list of the index columns
string GetDefinitionMatchKey(NamingStrategy namingStrategy)Builds a stable match key for compare (key columns + includes). Filter predicates are compared separately via DefinitionsEqual.
bool HasColumn(string columnName)Returns if the index contains the column name
bool HasNullableColumns()Returns if any column allows values
bool IsMatch(List<string> columns)Return true if Index contains the exact request columns
string NormalizeFilterPredicate(string predicate)Normalizes a filter / partial-index predicate for cross-dialect compare.
bool SetFillfactor(int fillfactor)Adjust the Index fill factor
string Sql(IConnection connection, bool noLock)Generates an SQL statement to create a new copy of the Index
string Sql(ISqlGenerator generator, bool noLock)Generates an SQL statement to create a new copy of the Index