Q 19. What is the difference between Cluster and Non-Cluster Index?
Ans :
| CLUSTERED INDEX | NON-CLUSTERED INDEX |
| The clustered index is faster. | The non-clustered index is slower. |
| The clustered index requires less memory for operations. | The non-Clustered index requires more memory for operations. |
| In a clustered index, the index is the main data. | In the Non-Clustered index, the index is a copy of data. |
| A table can have only one clustered index. | A table can have multiple non-clustered indexes. |
| The clustered index has an inherent ability to store data on the disk. | The non-Clustered index does not have the inherent ability to store data on the disk. |
| Clustered indexes store pointers to block not data. | The non-Clustered index store both value and a pointer to the the the actual row that holds data.
|
| In Clustered index leaf nodes are actual data itself. | In a Non-Clustered index, leaf nodes are not the actual data itself rather they only contain included columns. |
| In the Clustered index, the Clustered key defines the order of data within the table. | In the Non-Clustered index, the index key defines the order of data within the index. |
| A Clustered index is a type of index in which table records are physically reordered to match the index. | A Non-Clustered index is a special type of index in which the logical order of index does not match the physical stored order of the rows on the disk. |

No comments:
Post a Comment