DB Defrag.

Last Post 25 Jan 2011 08:07 AM by russellb. 7 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
river1
New Member
New Member

--
21 Jan 2011 06:18 AM
Hi,

  When i defrag. a DB what objects to i need to defrag? only the Indexs? or there are other objects that need to be defrag?  


 Thank you
rm
New Member
New Member

--
21 Jan 2011 06:42 AM
Can only defrag indices, defrag table via defrag clustered index on the table.
gunneyk
New Member
New Member

--
22 Jan 2011 11:31 AM
With SQL 2008 you can actually use ALTER TABLE REBUILD to rebuild a HEAP now as well
russellb
New Member
New Member

--
24 Jan 2011 06:01 AM
Ok, other than changing partitions or compression, why would we ever rebuild a heap?
rm
New Member
New Member

--
24 Jan 2011 06:46 AM
To defrag data pages in heap.
russellb
New Member
New Member

--
24 Jan 2011 10:45 AM
gotcha. thx
gunneyk
New Member
New Member

--
24 Jan 2011 12:53 PM
Russell, A HEAP can get forwarding pointers for rows that were updated but no longer fit on the page.. You can also get pages with too few rows after deletes so the only way to deal with it is to create a clustered index and drop it or with 2008 rebuild the table. But in most cases you should have a clustered index to begin with .
russellb
New Member
New Member

--
25 Jan 2011 08:07 AM
Yup, I wasn't thinking lol. Makes sense.


Acceptable Use Policy
---