Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Dropping indexes


Dropping indexes

Author
Message
Jagadish Kumar Punnapu
Jagadish Kumar Punnapu
SSC-Enthusiastic
SSC-Enthusiastic (149 reputation)SSC-Enthusiastic (149 reputation)SSC-Enthusiastic (149 reputation)SSC-Enthusiastic (149 reputation)SSC-Enthusiastic (149 reputation)SSC-Enthusiastic (149 reputation)SSC-Enthusiastic (149 reputation)SSC-Enthusiastic (149 reputation)

Group: General Forum Members
Points: 149 Visits: 111
Comments posted to this topic are about the item Dropping indexes
PRAMANA.DBA
PRAMANA.DBA
SSC Eights!
SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)SSC Eights! (860 reputation)

Group: General Forum Members
Points: 860 Visits: 1029
Good Question..
Carlo Romagnano
Carlo Romagnano
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3795 Visits: 3275
PRR.DB (1/1/2014)
Good Question..

+1
:-)

I run on tuttopodismo
free_mascot
free_mascot
Hall of Fame
Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)Hall of Fame (3.1K reputation)

Group: General Forum Members
Points: 3065 Visits: 2235
Good One!

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
steve.jacobs
steve.jacobs
SSChasing Mays
SSChasing Mays (636 reputation)SSChasing Mays (636 reputation)SSChasing Mays (636 reputation)SSChasing Mays (636 reputation)SSChasing Mays (636 reputation)SSChasing Mays (636 reputation)SSChasing Mays (636 reputation)SSChasing Mays (636 reputation)

Group: General Forum Members
Points: 636 Visits: 279
Really good question. Had to think about that one for a second :-D. Of course, I was thinking more into your question like "what if there are relational keys associated or referencing foreign keys?" which of course would throw errors.

Again, thanks.
Raghavendra Mudugal
Raghavendra Mudugal
SSCommitted
SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)SSCommitted (1.8K reputation)

Group: General Forum Members
Points: 1756 Visits: 2958
Good one, thank you for the post. Smile

(even though, I got it right with inconsistent thought on this "This may take significant time on large tables." and was wondering if the DB is online and users connected to it via application and the application performance would reduce in that particular time frame - and then thought; wait - why would they drop index on the main DB, such activity is done on mainly DWH in the maintenance window with very less users connected and the impact would be very less... and then thought may be this was the case of 2008 R2 and below and may be 2012 and 14 have bettered in this area.... well!!!)

ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
Thomas Abraham
Thomas Abraham
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2421 Visits: 2255
Got it wrong as I was using http://technet.microsoft.com/en-us/library/ms176118.aspx as a reference and it says, in part:

If a clustered index is dropped by using MOVE TO, any nonclustered indexes on the base table are rebuilt, but they remain in their original filegroups or partition schemes. If the base table is moved to a different filegroup or partition scheme, the nonclustered indexes are not moved to coincide with the new location of the base table (heap). Therefore, even if the nonclustered indexes were previously aligned with the clustered index, they might no longer be aligned with the heap.


which would appear to contradict the given answer.

What am I missing here?

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
george sibbald
george sibbald
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 7006 Visits: 13687
Thomas Abraham (1/2/2014)
Got it wrong as I was using http://technet.microsoft.com/en-us/library/ms176118.aspx as a reference and it says, in part:

If a clustered index is dropped by using MOVE TO, any nonclustered indexes on the base table are rebuilt, but they remain in their original filegroups or partition schemes. If the base table is moved to a different filegroup or partition scheme, the nonclustered indexes are not moved to coincide with the new location of the base table (heap). Therefore, even if the nonclustered indexes were previously aligned with the clustered index, they might no longer be aligned with the heap.


which would appear to contradict the given answer.

What am I missing here?


non-clustered indexes also contain the clustered index column(s) to identify the location of the actual rows to retrieve data from. If the clustered index is dropped then the non-clustered indexes have to be rebuilt to remove the clustered index and replace it with row ID information

---------------------------------------------------------------------
Thomas Abraham
Thomas Abraham
SSCrazy
SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)SSCrazy (2.4K reputation)

Group: General Forum Members
Points: 2421 Visits: 2255
george sibbald (1/2/2014)
Thomas Abraham (1/2/2014)
Got it wrong as I was using http://technet.microsoft.com/en-us/library/ms176118.aspx as a reference and it says, in part:

If a clustered index is dropped by using MOVE TO, any nonclustered indexes on the base table are rebuilt, but they remain in their original filegroups or partition schemes. If the base table is moved to a different filegroup or partition scheme, the nonclustered indexes are not moved to coincide with the new location of the base table (heap). Therefore, even if the nonclustered indexes were previously aligned with the clustered index, they might no longer be aligned with the heap.


which would appear to contradict the given answer.

What am I missing here?


non-clustered indexes also contain the clustered index column(s) to identify the location of the actual rows to retrieve data from. If the clustered index is dropped then the non-clustered indexes have to be rebuilt to remove the clustered index and replace it with row ID information


I understand that part. However, the reference seemed to imply that the non-clustered indexes had to be MANUALLY rebuilt, IF the table was moved to a different filegroup or partition scheme.

Please don't go. The drones need you. They look up to you.
Connect to me on LinkedIn
george sibbald
george sibbald
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 7006 Visits: 13687
I would read that If as an 'as well'. This is because the clustered index is still being dropped, but the data is moved at the same time, but is now a heap.

Best details on when non-clustered indexes get rebuilt here

---------------------------------------------------------------------
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search