Category Archives: SQL Indexes

SQL Indexes

Interview question – Is Clustered index on column with duplicate values possible?

By | August 13, 2015

Through this article, we are going to discuss three important interview questions of SQL which are given below:-  1) Can we create clustered index on a column containing duplicate values?  2) Can we create a Primary Key on a table on which a clustered index is already defined? 3) If a clustered index is already defined on a… Read More »

SQL Script to find the missing indexes

By | January 25, 2015

Script to find the missing indexes Performance tuning in SQL is important exercise and index creation is an important part of it. Sometimes base on the frequent SQL queries, we need to create some indexes or missing indexes which are enhance the query performance. Below script will help in finding the missing indexes. SELECT db_name(d.database_id) dbname , object_name(d.object_id)… Read More »

Script to find the Fragmentation of indexes

By | January 4, 2015

Script to find the Fragmentation in Indexes In my previous articles, Fragmentation in SQL Server and Rebuild And Reorganization of Indexes , we talk in detail about Index fragmentation and rebuild or reorganize the indexes. Below is the SQL script which we can use to find the Fragmentation in Indexes created on the database. SELECT OBJECT_NAME(OBJECT_ID), index_id,index_type_desc,index_level,… Read More »

Rebuild And Reorganization of Indexes

By | December 31, 2012

Rebuild and  Reorganization of Indexes SQL Server has the ability of maintaining the indexes whenever we makes changes (update, Insert, Delete) in the tables. Over a period of time, the may causes the fragmentation on the table in which  the logical ordering based on the key value pairs does not match with the physical ordering inside the data… Read More »

Fragmentation in SQL Server

By | December 31, 2012

Fragmentation:- Fragmentation can be defined as condition where data is stored in a non continuous manner. In can be defined into two types 1. Internal Fragmentation 2. External Fragmentation Internal Fragmentation:- In this fragmentation, there exists a space between the different records within a page. This is caused due to the Insert, delete or Update process… Read More »

Difference between Clustered Index and Non clustered Index

By | January 3, 2010

Indexes-Indexing  is way to sort and search records in the table. It will improve the speed of locating and retrieval of records from the table.It can be compared with the index which we use in the book to search a particular record. In Sql Server there are two types of Index 1) Clustered Index 2)… Read More »