聚集索引和非聚集索引有什么区别? [英] What are the differences between a clustered and a non-clustered index?

查看:34
本文介绍了聚集索引和非聚集索引有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

聚簇非聚簇索引有什么区别?

推荐答案

聚集索引

  • 每桌仅限一张
  • 读取速度比非集群更快,因为数据是按索引顺序物理存储的

非聚集索引

  • 每桌可以多次使用
  • 插入和更新操作比聚集索引更快

当使用使用索引的字段选择数据时,这两种类型的索引都会提高性能,但将减慢更新和插入操作.

Both types of index will improve performance when select data with fields that use the index but will slow down update and insert operations.

由于插入和更新较慢,因此应在通常递增的字段上设置聚集索引,即 Id 或 Timestamp.

Because of the slower insert and update clustered indexes should be set on a field that is normally incremental ie Id or Timestamp.

SQL Server 通常只会使用索引的选择性高于 95% 的索引.

SQL Server will normally only use an index if its selectivity is above 95%.

这篇关于聚集索引和非聚集索引有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆