Groups | Blog | Home
all groups > sql server (alternate) > october 2005 >

sql server (alternate) : Defragment Heap Tables



kmounkhaty NO[at]SPAM yahoo.com
10/13/2005 12:04:30 PM
Hi guru,

I've been new company for only a month and started analysing Index
Fragmentation.

After I ran DBCC DBREINDEX and capture data into permanent table, I 've
seen lots of tables with no indexes. These tables showed:

Very low scan density,
High extent fragmentation
High Avg. Bytes Free per Page

What are the best strategies to defragment tables with no indexes?

I'm planning to make a rule that each table must have a clustered index
and this index must be created on the best column (highest
selectivity).

Please help.

Thanks,
Silaphet,
Erland Sommarskog
10/13/2005 9:22:11 PM
kmounkhaty@yahoo.com (smounkhaty@bremer.com) writes:
[quoted text, click to view]

Create a clustered index on them. If the index is absolute undesired,
drop the index once your done.

[quoted text, click to view]

Yes, that is a good rule. Heap tables with deletions can easily become
very fragmented.

As for which column to cluster on, you may want to find a column
that grows monotonically, if all you want to do is avoid fragmentation.
Of course, adding indexes to improve queries is a good idea too!


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
AddThis Social Bookmark Button