Describe why it takes so long to drop a clustered index

          

Interview questions

Why it takes so long to drop a clustered index

Next>>         SQL Server tutorial  

SQL Server - so long to drop a clustered index - Feb 27, 2010 at 11:50 AM by Shuchi Gauri

Describe why it takes so long to drop a clustered index.

When a clustered index is dropped, the index definition is deleted from metadata and all the data rows that were stored in the leaf level of the clustered index. In addition to dropping the clustered index, all nonclustered indexes on the table must be rebuilt to replace the clustered index keys with row pointers to the heap, which takes a lot of time. To save time, when we need to drop all indexes on a table, we must drop the nonclustered indexes first and then the clustered indexes in the end.

SQL Server - so long to drop a clustered index - May 05, 2009 at 22:00 PM by Rajmeet Ghai

Describe why it takes so long to drop a clustered index.

A clustered index is uses the index key to sort the data of the table. And since there can be only one sort order, there can be only one clustered index. When the table has a clustered index, the pointers contain the clustered index keys for that row. And hence when a clustered index is dropped, the SQL server has to recreate non clustered indexes for that table by replacing the clustered index keys by the RowID. This consumes a lot of time. 

SQL Server - so long to drop a clustered index - June 21, 2009 at 09:00 AM by Amit Satpute

Describe why it takes so long to drop a clustered index.

  • A table can have only one cluster index which sorts the data in the table physically. The sort order for the data that has been sorted physically cannot vary.
  • A table with clustered index has pointers that contain the clustered index keys for that row.
  • The drop operation is time consuming as the clustered indexes then need to be replaced by the RowIDs for the data.

Next>>

Also read

What is the actions prevented once referential integrity is enforced?

Answer - Following are the actions prevented once referential integrity is enforced......

What is index? Define its types.

Answer - Index can be thought as index of the book that is used for fast retrieval of information. Index uses one or more column index keys and pointers to the record to locate record.........

What are the steps to process a single SELECT statement?

Answer - SQL Server uses the following steps to process a single SELECT statement....



Write your comment - Share Knowledge and Experience


 

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring