Articles → SQL SERVER → Indexes In SQL Server
Indexes In SQL Server
What Do I Need On My System?
What Are The Technical Concepts I Need To Know?
- What are tables in SQL server?
- What is a primary key?
What Is A Database Index?
- An index is a data structure.
- Indexes improve the speed of data retrieval operations.
- Maintaining indexes incurs additional costs in terms of storage and processing overhead.
Types Of Database Indexes In SQL Server
- Clustered index
- Non-clustered index
How Physical Sorting And Logical Sorting Are Different
B-Tree
Cluster Index
- Only one clustered index per table
- Data is stored in leaf node of B-Tree. All other nodes contain index rows
- Data is physically sorted
-- Syntax for creating clustered index
CREATE CLUSTERED INDEX index_name ON table_name (column_name)
Non-Clustered Index
- More than one non-clustered index can be implemented on a table
- Leaf node of B-Tree contains the address of data
- Data is logically sorted
-- Syntax for creating non clustered index
CREATE NONCLUSTERED INDEX index_name ON table_name (column_name)
Posted By - | Karan Gupta |
|
Posted On - | Wednesday, January 28, 2015 |