Types of Indexing: As we have read, Indexes are nothing but a way of reducing the cost of query. There are mainly two types of indexing: Clustered and Non-clustered index. Clustered Index: 1. A clustered index is actually a table where the data for the rows are stored. It defines the order of the table data based on the key values that can be sorted in only one way. 2. There can be only one Clustered index possible in a table 3. Clustered index re-orders the table record. 4. When a table has a clustered index, the table is called a 'clustered table'. If a table has no clustered index, its data rows are stored in an unordered structure called a heap. 5. If you configure a PRIMARY KEY, Database Engine automatically creates a clustered index, unless a clustered index already exists. Advantages: 1. Ideal for range or group by with max, min, count type queries 2. Helps you to minimize page transfers and maximize the cache hits. 3. Fast data access and additional space is not required. 4. Improves the performance for retrieving the data Disadvantages: 1. Needs extra work for SQL queries, such as insert, updates, and deletes. 2. Takes longer time to update/insert records 3. Size of clustered index is quite large. 4. Longer time to update records when the fields in the clustered index are changed. Example: Dictionary, in the dictionary sorting order is alphabetical there is no separate index page. Syntax: create Clustered index IX_table_name_column_name on table_name (column_name ASC)To be contd... - Study24x7
Social learning Network
58 followers study24x7 12 May 2020 06:28 PM study24x7 study24x7

Types of Indexing: As we have read, Indexes are nothing but a way of reducing the cost of query. There are mainly two types of indexing: Clustered and Non-clustered index. Clustered Index: 1. A clustered index is actually a table where the data for the rows are stored. It defin...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles