본문 바로가기

컴퓨터 과학/데이터베이스

cluster index와 non-cluster index (HackerRank - DataBase)

반응형

1. How many index architecture type classifications are there in MS SQL Server?

 

-> 2 : Cluster index and non-cluster index

 

Cluster index:  A clustered index organizes the actual physical order of data in a table based on a chosen column, typically the primary key. However, each table can have only one clustered index. Clustered indexes are best suited for operations like sorting and range-based queries since they determine the physical data order.

 

Non-cluster index: non-clustered indexes are separate structures that contain a copy of indexed columns along with pointers to the corresponding rows in the table. Tables can have multiple non-clustered indexes, and they are particularly useful for speeding up queries that involve specific columns or combinations of columns, enhancing query performance and efficiency.

 

쉽게이야기해서 Cluster index는 데이터 주소로 바로 접근하는 것이고 non-cluster index는 포인터를 통해 접근하는 것이 조금 다르다.

참고: https://gwang920.github.io/database/clusterednonclustered/

 

Clustered vs NonClustered (index 개념)

이번 포스팅에서는 Database의 index 와 관련된 Clustered와 NonClustered의 개념을 알아보자.

gwang920.github.io

 

 

 

반응형