自定义索引 (Master Data Services)Custom Index (Master Data Services)

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) - 仅限 Windows 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) - Windows only 是Azure SQL 托管实例Azure SQL Managed InstanceYesAzure SQL 托管实例Azure SQL Managed Instance

自定义索引在实体中 (单个索引) 或 (复合索引) 的特性列表中创建非聚集索引。Custom indexes create a nonclustered index on one attribute (single index) or on a list of attributes (composite index), in an entity. 通常索引可提高查询过程的性能。Generally indexes improve the performance of querying process. 有关 SQL Server 索引的详细信息,请参阅 索引For more information about SQL Server indexes, see Indexes.

索引类型Type of Indexes

可以为每个实体创建以下类型的多个自定义索引。You can create the following types of multiple custom indexes for each entity.

  • 唯一索引Unique index

  • 非唯一索引Non-Unique index

唯一索引确保索引的列中不包含重复值。An unique index ensures that the indexed column contains no duplicate values. 对于组合唯一索引,索引确保所选特性列表中每个值的组合都是唯一的。For composite unique indexes, the index ensures that each combination of values in the list of selected attributes is unique. 如果所选特性存在重复值,则不能创建唯一索引。A unique index cannot be created if duplicate values for the selected attributes exist.

规则Rules

以下规则适用于自定义索引,唯一和非唯一均可。The following rules apply to custom indexes, both unique and non-unique.

  • 若要创建自定义索引,请确保至少选择一个特性。To create a custom index, make sure that you select at least one attribute.

  • 如果尝试保存的索引与另一索引具有相同的特性列表和唯一性标志,则无法保存该索引。If you try to save an index that has the same list of attributes and uniqueness flag as another index, the index cannot be saved. 会显示错误。An error is shown.

    备注

    MDS 自动为某些特性创建索引(如 DBA 和代码)。MDS automatically creates indexes for certain attributes (such as DBAs and Code). 这意味着不能创建包含这些特性之一且不包含其他特性的另一个索引。This means you can't create another index that contains one of these attribute and contains no other attributes.

  • 只要其他索引中至少有一个不同的特性,特性就可以包含在多个自定义索引中。Attributes can be included in more than one custom index as long as there is at least one different attribute in the other indexes. 否则,这些索引是相同的。Otherwise, the indexes are the same.

  • 如果创建包含很多或大型特性的索引,并且所选特性的总大小超过索引键的最大大小(900 个字节),则该索引将无法保存。If you create an index that contains many attributes, or large-size attributes, and the total size of the selected attributes exceeds the maximum index key size (900-bytes), the index cannot be saved.

  • 可以对叶成员特性创建自定义索引,文件特性除外。A custom index can be created on leaf member attributes, excluding file attributes.

  • 如果想要删除自定义索引中包含的特性,以下内容适用。If you want to delete an attribute that is included in a custom index, the following applies.

    • 如果仅对某一特性(单个索引)创建索引,则会将该特性和索引都删除。If the index is created on only one attribute (single index), the attribute and the index will both be deleted.

    • 如果对多个特性(组合索引)创建索引,在编辑该索引前不能删除该特性。If the index is created on more than one attribute (composite index), the attribute cannot be deleted until you edit the index.

  • 不能更改自定义索引中包含的特性类型。The type of an attribute that is included in an custom index cannot be changed.

任务说明Task Description 主题Topic
创建索引Create an Index 创建索引 (Master Data Services)Create an Index (Master Data Services)
编辑和删除索引Edit and Delete an Index 编辑和删除索引 (Master Data Services)Edit and Delete an Index (Master Data Services)