Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
BRH 6
Index 6
Non-Clustered Index 5
Performance 4
#SQLServer 3
#TSQL 2
SQLServer 2
Clustered Index 2
Filtered Index 2
SSMS 2

Archive · View All
April 2010 7
March 2010 4
August 2010 2
May 2010 2
October 2011 1
September 2010 1

Indexing Basics Part 1

Mar 18 2010 10:41AM by Dinesh Asanka   

Indexes are very important when it comes to design your databases for better performance.

In this article we will look into what are indexes types we have in SQL Server 2008.

In SQL Server you have two types of indexes.

  1. Clustered Index (CLI)

Clustered index is the actual table/view sorted in order of the cluster key. Because of this you can have one CLI per table/view. CLI analogies to an index of a typical telephone directory where you search by the name and there it self you find other details like address and telephone number in which you do not have to do a another lookup.

     2. Non-Clustered Index (NCI)

A non-clustered index has the indexed columns and a pointer or bookmark pointing to the actual row. You can create 999 NCIs which is increased from 249 in SQL Server 2005. NCI analogies to index you have in the back side of a book. If you want find out something faster rather than reading the entire book, you will navigate to the index, then get the topic you need. There you have the page number (index pointer) from which you can do a lookup to the data table to find out necessary information you need. 

In both indexes, there are two limitations.

  1. You cannot create indexes with more than 16 columns.
  2. You cannot have indexes with more than 900 bytes.

 However, there is a workaround which came along with SQL Server 2005. That is you can Create an index with include statement. Above two limitation will not cover for the columns you are having in the include statement.

 Let us say we have there columns like this.

 Title  nvarchar(5)

 Name nvarchar(400)

 Passport nvarchar(50)

 If you create an index for this you will get an error message as following.

 Warning! The maximum key length is 900 bytes. The index 'IX_Title_Name_Passport' has maximum length of 910 bytes. For some combination of large values, the insert/update operation will fail.

 So you will not be able to insert/update data if the above three columns has value more than 900 bytes.

 To avoid this you can create an index with include.

CREATE NONCLUSTERED INDEX [IX_Title_Passport_Include_Name] 
ON dbo.[Test]
(
	Title ,Passport ASC
)
INCLUDE(Name)

 Filtered Index

Filtered Index is used to index a portion of rows in a table that means it applies filter on INDEX which improves query performance, reduce index maintenance costs, and reduce index storage costs compared with full-table indexes. Filtered indexes are available only with SQL Server 2008. This is how you create a filtered index.

CREATE NONCLUSTERED INDEX NCI_Department
	ON HumanResources.Employee(EmployeeID)
	WHERE Title= 'Marketing Manager'

You can have any where clause for filtered index.

This is just an overview of indexes we have in SQL Server 2008. In future articles we will see what are the usage of indexes.

Tags: Index, Filtered Index, Non-Clustered Index, Clustered Index,


Dinesh Asanka
117 · 1% · 444
0
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]