Jul 7, 2008

Clustered Index vs Non Clustered Index

Clustered Index | Non Clustered Index

Indexing is used to get fast retrival of data. The indexing which is done on physical storage is known as Clustered Indexing. And an indexing which is performed logically is know as Non Clustered Indexing.

Clustered Indexing can be only one per table as we phyisically can arrange in one way only, while a table can have 249 Non Clustered Index.

Indexing should be used on table which not very frequently having update operations on it. There are many ways which can be used to get more performance while retrieving data.

Covering Index is --> when you create an index on fields which you are also using in select query, is know as covering index.

For ex suppose
Employee Table
---------------
EmpID int
EmpName
EmpDept
EmpDesing

----------------
If you have a query which only select EmpID and EmpName, then we can create a non clustered index with these two fields only, and it gains our performance while retrieving data.

No comments:

Post a Comment

SQL - Difference between CAST,CONVERT and PARSE

TODO---