Saturday, November 28, 2015

Indexes

                                              Indexes

  • Indexes plays a major role when a data is to be searched in bulk records.
  • In indexing a separate index structure is created that includes search key value and address of a record and index always stores the data in ascending order for performing.
  • Indexing is classified into the following types
  1. Clustered Index
  2. Non-Clustered Index
  3. Unique Index
Syntax:
Create [Unique]/[Clustered]/[Non-Clustered] Index
index_name ON table_name (column1, column2,........)

Composite Index: Index created on multiple columns is called as Composite index.

1. Clustered Index:
  • Clustered index will alter the physical representation of rows in a table(In ascending order).
  • A table can have only one clustered index.
  • This index should be created for a column where more than one search value is available.
2. Non-Clustered Index:
  • It will not allow the physical representation of rows
  • It will not sort the data of a table.
  • It is a default index created.
3.Unique Index:
  • This contains only on those columns which contains unique data.
  • This is Automatically created when Unique Constraint is specified on a column.(unique non-clustered)


No comments:

Post a Comment