Indexing in database
Diffrence Between Clusterd index and Non clusterd index in depth
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted Jan 12, 2017, 8:56 AM EST
Munesh SharmaRank #174 · 13.9K reputationPosted Jan 12, 2017, 6:17 PM EST
Clustered Index
Non Clustered Index
Both types of index will improve performance when select data with fields that use the index but will slow down update and insert operations.
Because of the slower insert and update clustered indexes should be set on a field that is normally incremental ie Id or Timestamp.
SQL Server will normally only use an index if its selectivity is above 95%.
Daniel JonesRank #5,109 · 311 reputationPosted Jan 12, 2017, 6:41 PM EST
Vineet KumarRank #3,087 · 464 reputationPosted Jan 12, 2017, 8:19 PM EST
Saddam Mohd150 reputationPosted Jan 17, 2017, 7:47 PM EST
hi lalit
Clustered indexes sort and store the data rows in the table or view based on their key values. These are the columns included in the index definition. There can be only one clustered index per table, because the data rows themselves can be sorted in only one order.
The only time the data rows in a table are stored in sorted order is when the table contains a clustered index. When a table has a clustered index, the table is called a clustered table. If a table has no clustered index, its data rows are stored in an unordered structure called a heap.
Nonclustered
Nonclustered indexes have a structure separate from the data rows. A nonclustered index contains the nonclustered index key values and each key value entry has a pointer to the data row that contains the key value.
The pointer from an index row in a nonclustered index to a data row is called a row locator. The structure of the row locator depends on whether the data pages are stored in a heap or a clustered table. For a heap, a row locator is a pointer to the row. For a clustered table, the row locator is the clustered index key.
Reference...
https://msdn.microsoft.com/en-IN/library/ms190457.aspx