Saturday, July 6, 2013

Database Indexes

Database index is a data-structure which improves retrieval of data from database tables. Indexes are used to quickly locate data without having to go through every row in database table. 

Source : kindleyourbrain
If you create an index it'll create a data-structure with the field value in which you created the index and a pointer to the record in the original table.The values in an index is sorted.

The downside of creating indexes is it requires additional disk space. Also when you have many indexes data writing will be bit slower because you need add a record to index data structures as well.

You can use indexes to tune performance of the database. See how to work with SQL Server Indexes here

Check below video to learn more about indexes. Also you check database indexes videos in Youtube.

Clustered vs NonClustered indexes

A clustered index is a special kind of index means you're telling the database to store similar values close to one another on the disk. This is the reason why you can have only one clustered index for a table. This has the benefit of rapid retrieval of records. By default a column with a primary key already has a clustered index.

Index must knows
https://www.simple-talk.com/sql/performance/14-sql-server-indexing-questions-you-were-too-shy-to-ask/

You can have many nonclustered indexes.



Resources

0 comments:

Post a Comment

Powered by Blogger.


Software Architect at Surge Global/ Certified Scrum Master

Experienced in Product Design, Software Engineering, Team management and Practicing Agile methodologies.

Search This Blog

Facebook