Table "Key"

ID 2000000063
Namespace: System.Reflection

Virtual table that provides metadata information about all keys defined for tables in the system. This table enables introspection of table indexing strategies, key definitions, and performance characteristics.

Remarks

The Key table is essential for understanding table performance characteristics and indexing strategies. It provides detailed information about primary keys, secondary keys, SIFT (Sum Index Field Technology) keys, and their corresponding SQL indexes. This information is crucial for performance analysis, query optimization, and understanding data access patterns. The table includes information about key enablement status, SQL index maintenance, and SIFT index configuration, which directly impacts query performance and data aggregation capabilities in Business Central applications.

Properties

Name Value
DataPerCompany False
Scope Cloud

Fields

Name Type Description
TableNo Integer

The table number that contains this key definition.

"No." Integer

The sequential number of the key within the table.

TableName Text[30]

The name of the table that contains this key.

"Key" Text[250]

The field names that compose this key, listed in order of precedence.

SumIndexFields Text[250]

The fields that are maintained in SIFT (Sum Index Field Technology) for aggregation purposes.

SQLIndex Text[250]

The name of the corresponding SQL index created in the database for this key.

Enabled Boolean

Indicates whether this key is currently enabled and available for use.

MaintainSQLIndex Boolean

Indicates whether the SQL index for this key is actively maintained in the database.

MaintainSIFTIndex Boolean

Indicates whether the SIFT index for this key is actively maintained for aggregation queries.

Clustered Boolean

Indicates whether this key is defined as the clustered index in the database.

ObsoleteState Option

The obsolete state indicating whether the key is obsolete, pending removal, or removed.

ObsoleteReason Text[30]

The reason provided when the key was marked as obsolete.

Unique Boolean

Indicates whether this key enforces uniqueness constraints on the field combination.

"Key name" Text[128]

The Key's name, duplicates may occur when multiple keys are defined on the same table but defined in seperate table extensions. Table Id + Key Name + Source App ID is an unique combination.

"Source App ID" Guid

The application ID of the source of the key. Notice this is the table based placement location of the key, not the application ID of the table where the key is defined. An extension defined key on a base table will have the application ID of the base table, not the extension.

SystemId Guid
SystemCreatedAt DateTime
SystemCreatedBy Guid
SystemModifiedAt DateTime
SystemModifiedBy Guid
SystemRowVersion BigInteger

See also