| Start | ||||||
|---|---|---|---|---|---|---|
| Create Clustered index With a clustered index the leaf pages contain the actual table rows. Therefore, there can be only one clustered index. |
||||||
| Create Non-Clustered index Non-clustered indexes have a structure separate from the data rows. A non-clustered index contains the non-clustered index key values and each key value entry has a pointer to the data row that contains the key value. There can be maximum 999 non-clustered index on SQL Server 2008/ 2012. Link for reference: https://msdn.microsoft.com/en-us/library/ms143432.aspx (opens new window) |
||||||
Show index info |
||||||
Drop index |
||||||
Index on view |
||||||
Returns size and fragmentation indexes |
||||||
Reorganize and rebuild index
|
||||||
| Rebuild or reorganize all indexes on a table Rebuilding indexes is done using the following statement This drops the index and recreates it, removing fragementation, reclaims disk space and reorders index pages. One can also reorganize an index using which will use minimal system resources and defragments the leaf level of clustered and nonclustered indexes on tables and views by physically reordering the leaf-level pages to match the logical, left to right, order of the leaf nodes |
||||||
Rebuild all index database |
||||||
| Index investigations You could use "SP_HELPINDEX Table_Name", but Kimberly Tripp has a stored procedure (that can be found here (opens new window)), which is better example, as it shows more about the indexes, including columns and filter definition, for example: Alternatively, Tibor Karaszi has a stored procedure (found here (opens new window)). The later will show information on index usage too, and optionally provide a list of index suggestions. Usage: |
Read Article
https://develop.horje.com/learn/1434/reference