Appearance
IndexInformation Class
Definition
Provides Index details for schema definition, discovery, and ops stats.
- Namespace:
JASE.Database - Assembly:
JASE.Database.dll
Constructors
| Name | Description |
|---|---|
IndexInformation() | Creates an empty index definition (for discovery / object initializers). |
Properties
| Name | Description |
|---|---|
Columns | List of IndexColumn entries about the indexes Columns |
Comment | Optional SQL comment / description for the index. |
EstimatedRows | Estimated number of rows in the table |
ExcludeNulls | When , CREATE INDEX adds IS NOT NULL for each key column |
FillFactor | Fill factor percentage for the index |
FilterPredicate | Gets the optional filter predicate applied when creating a filtered or partial index. |
Fragmentation | Current fragmentation percentage of the index |
IncludeColumns | Non-key include / covering columns. |
IndexType | Index type description |
IsClustered | True when index is clustered |
IsPrimaryKey | True for a tables Primary Key |
IsSequentialKeyOptimized | True if the index is optimized for sequential key inserts |
IsUnique | True if index requires a unique combination of values |
IsValid | True if the index is valid |
LookUps | Number of lookups using the index |
Name | Index name |
Pages | Number of pages allocated to the index |
Scans | Number of index scans |
Schema | Schema the index is contained within |
Seeks | Number of index seeks |
TableName | The table indexed |
Updates | Number of updates to the index |
Methods
| Name | Description |
|---|---|
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 |