Posts

Showing posts with the label clustered

SQL Server Index Basics

Non Clustered and Clustered Index: The primary key created for the StudId column will create a clustered index for the Studid column. A table can have only one clustered index on it. When creating the clustered index, SQL server 2005 reads the Studid column and forms a Binary tree on it. This binary tree information is then stored separately in the disc. A non-clustered index is useful for columns that have some repeated values. Say for example, AccountType column of a bank database may have 10 million rows. But, the distinct values of account type may be 10-15. A clustered index is automatically created when we create the primary key for the table. We need to take care of the creation of the non-clustered index. Recommendation: -Indexes with INCLUDEs are a big win for frequently-called range queries. -If access is always per-record on the clustered index, don’t add indexes with INCUDEs. -For frequently called relatively-static data, consider using multiple indexes with INCLUDEs...