- Clustered index
Clustered index forms B-tree (Balanced tree) kind structure for fast search
Clustered index has data pages on leaf node
Only one clustered index can be created
why? because a clustered index form a physical ordering of data and we can't have multiple physical ordering of data
If A table has clustered index data stored in sorted manner
If A table not have clustered index data stored in a manner called heap
Sql server automatically creates clustered index on primary key
- Non clustered index
The pointer from an index row in a Non-clustered index to a data row is called a row locator. The structure of the row locator depends on whether the data pages are stored in a heap or a clustered table. For a heap, a row locator is a pointer to the row. For a clustered table, the row locator is the clustered index key.
You can add non key columns to the leaf level of the Non-clustered index to by-pass existing index key limits, 900 bytes and 16 key columns, and execute fully covered, indexed, queries.
It is logical ordering of data, not physical, physically data stored in different manner
It has index rows on leaf nodes not data pages those works like pointers to actual data pages
it could be clustered index
249 Non clustered index can be created on a table
Sql server automatically creates non clustered index on any other unique key
No comments:
Post a Comment