聚集索引和没有索引之间有什么区别

时间:2022-07-21 13:24:09

So i know what is clustered index and non clustered index..

所以我知道什么是聚簇索引和非聚簇索引..

But is it same as to create a index for one column in a table and leave other columns in the same table without creating any indexes rather than creating a non clustered index on other columns?

但是,为表中的一列创建索引并将其他列保留在同一个表中而不创建任何索引而不是在其他列上创建非聚集索引是否相同?

I am bit confused , please clarify?

我有点困惑,请澄清一下?

1 个解决方案

#1


1  

The easiest way to think about it is like DVDs on a shelf. You've already decided to cluster the dvds by type (of dvd). After that you might want to sort(index) them another way (alphabetically by name or by year released). Doing this helps you find DVDs easier and it's roughly the same in SQL.

最简单的思考方式就像架子上的DVD一样。你已经决定按类型(DVD)聚类dvds。之后,您可能希望以另一种方式对它们进行排序(索引)(按名称或按年份的字母顺序排序)。这样做可以帮助您更轻松地查找DVD,并且在SQL中大致相同。

When used correctly indexes can speed up your queries as less work is required to find what is expected from the query.

正确使用索引可以加快查询速度,因为查找查询所需的工作量较少。

#1


1  

The easiest way to think about it is like DVDs on a shelf. You've already decided to cluster the dvds by type (of dvd). After that you might want to sort(index) them another way (alphabetically by name or by year released). Doing this helps you find DVDs easier and it's roughly the same in SQL.

最简单的思考方式就像架子上的DVD一样。你已经决定按类型(DVD)聚类dvds。之后,您可能希望以另一种方式对它们进行排序(索引)(按名称或按年份的字母顺序排序)。这样做可以帮助您更轻松地查找DVD,并且在SQL中大致相同。

When used correctly indexes can speed up your queries as less work is required to find what is expected from the query.

正确使用索引可以加快查询速度,因为查找查询所需的工作量较少。