December 31, 2013 at 11:48 pm
If i drop a clustered index from table, how the non clustered behave when this is on same table.
Will all the non clustered index drop and recreate? or it just reorganize with rid?
What is the performance impact when droaping clustered index from a big table,also that having multiple non clustered index?
January 1, 2014 at 12:34 am
sql crazy kid (12/31/2013)
If i drop a clustered index from table, how the non clustered behave when this is on same table.Will all the non clustered index drop and recreate? or it just reorganize with rid?
What is the performance impact when droaping clustered index from a big table,also that having multiple non clustered index?
If you drop a Clustered Index, all of the NCIs will rebuild because all NCIs contain either the Clustered Index Key or, in the absence of a CI, they will contain a rowID for the HEAP. So far as the performance impact goes, it depends. If a query is using the CI columns of the NCI and those suddenly go away, the index might not even be used for the query which might result in a table scan unless a different index is sufficient and is picked up by the query.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 1, 2014 at 1:06 am
Jeff Moden (1/1/2014)
sql crazy kid (12/31/2013)
If i drop a clustered index from table, how the non clustered behave when this is on same table.Will all the non clustered index drop and recreate? or it just reorganize with rid?
What is the performance impact when droaping clustered index from a big table,also that having multiple non clustered index?
If you drop a Clustered Index, all of the NCIs will rebuild because all NCIs contain either the Clustered Index Key or, in the absence of a CI, they will contain a rowID for the HEAP. So far as the performance impact goes, it depends. If a query is using the CI columns of the NCI and those suddenly go away, the index might not even be used for the query which might result in a table scan unless a different index is sufficient and is picked up by the query.
Thanks Jeff,
This means all the non clustered for the table will be internally dropped and recreated either with new clustered key or rid [In case of no cix].
January 1, 2014 at 10:23 am
sql crazy kid (1/1/2014)
Jeff Moden (1/1/2014)
sql crazy kid (12/31/2013)
If i drop a clustered index from table, how the non clustered behave when this is on same table.Will all the non clustered index drop and recreate? or it just reorganize with rid?
What is the performance impact when droaping clustered index from a big table,also that having multiple non clustered index?
If you drop a Clustered Index, all of the NCIs will rebuild because all NCIs contain either the Clustered Index Key or, in the absence of a CI, they will contain a rowID for the HEAP. So far as the performance impact goes, it depends. If a query is using the CI columns of the NCI and those suddenly go away, the index might not even be used for the query which might result in a table scan unless a different index is sufficient and is picked up by the query.
Thanks Jeff,
This means all the non clustered for the table will be internally dropped and recreated either with new clustered key or rid [In case of no cix].
I don't believe they're actually dropped, just rebuilt. That's kind of expensive because the pages of the old version of the index aren't actually dropped until the new version is available and that could cause a bit of growth in the file group. Also, unless you're in the Bulk-Inserted or Simple recovery mode, the rebuilds will all be fully logged.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 2, 2014 at 5:57 am
This is just one article you can look at about dropping a clustered index.
http://technet.microsoft.com/en-US/library/ms190691(v=SQL.105).aspx
January 2, 2014 at 6:44 am
I guess the question remains... why would you drop a clustered index on a table?
January 2, 2014 at 7:18 am
Markus (1/2/2014)
I guess the question remains... why would you drop a clustered index on a table?
I can see doing it only if you need to change the keys for something like partitioning but, even then, I believe a REBUILD will do it. Other than that, I can't see doing it.
Point well taken though.
@SQL Crazy Kid,
Why do you need to drop the Clustered Index?
--Jeff Moden
Change is inevitable... Change for the better is not.
January 2, 2014 at 10:33 am
Jeff Moden (1/2/2014)
Markus (1/2/2014)
I guess the question remains... why would you drop a clustered index on a table?I can see doing it only if you need to change the keys for something like partitioning but, even then, I believe a REBUILD will do it. Other than that, I can't see doing it.
Point well taken though.
@SQL Crazy Kid,
Why do you need to drop the Clustered Index?
Hello,
My post is to measure the impact in case we drop and recreate CIX either with new combosit key or change of key.I was in assumption that all the NIX associated with the CIX will reorganize instead of rebuild [Reorganizing an index uses minimal system resources].
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply