'Indexes' are a means of accessing records in a table in a faster manner without having to read the whole table.
Indexes
The 'Indexes' behave as a pointer to where the record is kept in a table. This is similar to the inverted tree
structure. Placing indexes on a table help up speed up data retrieval. Without having an index, SQL Server would need
to read through all of the data ina table in order to find the rows that satisfy the query. Indexes can be created on a single
column or on a combination of columns.
SQL 'Indexes' Syntax
Create Index indexname
On tablename (columnname)
The Index Example
Create Index EmpIndex
On Employees (EmployeeID)
Drop index indexname;
You can also delete any of the indexes that you have defined by using the above 'Drop Index' option.
In SQL server, the following types of indexes are available:
- Clustered Index
- Non Clustered Index