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

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

问题描述

群集非群集索引之间有什么区别?

推荐答案

聚集索引


  • 每个表只有一个

  • 读取速度比非聚集读取速度快,因为数据按索引顺序物理存储

非聚集索引


  • 每张表可多次使用

  • 插入和更新操作比聚集索引更快

当选择包含使用索引但会降低更新和插入操作的字段的数据时,这两种类型的索引都会提高性能。

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如果索引的选择性高于95%,服务器通常只使用索引。

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

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

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