What do Clustered and Non clustered index actually mean?

前端 未结 11 2125
粉色の甜心
粉色の甜心 2020-11-22 06:40

I have a limited exposure to DB and have only used DB as an application programmer. I want to know about Clustered and Non clustered indexes. I goo

11条回答
  •  梦谈多话
    2020-11-22 07:37

    With a clustered index the rows are stored physically on the disk in the same order as the index. Therefore, there can be only one clustered index.

    With a non clustered index there is a second list that has pointers to the physical rows. You can have many non clustered indices, although each new index will increase the time it takes to write new records.

    It is generally faster to read from a clustered index if you want to get back all the columns. You do not have to go first to the index and then to the table.

    Writing to a table with a clustered index can be slower, if there is a need to rearrange the data.

提交回复
热议问题