SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Heaps rebuild


Heaps rebuild

Author
Message
Igor Micev
Igor Micev
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: 7040 Visits: 5138
Comments posted to this topic are about the item Heaps rebuild

Igor Micev,
SQL Server developer at Seavus
My blog: www.igormicev.com
domenico.delbrocco
domenico.delbrocco
SSC Veteran
SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)SSC Veteran (297 reputation)

Group: General Forum Members
Points: 297 Visits: 91
nice question: I've never used SORT_IN_TEMPDB and DATA_COMPRESSION and I've never received that warning message, but with a little bit of intuition I got the two points :-)
NicHopper
NicHopper
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2206 Visits: 1907
It took me two cups of tea and a little brain power but I got it right!

Nice question by the way, thank you.

------------------------------------------------------------
Check out my blog

http://www.sqlservercentral.com/articles/Best+Practices/61537/
paul s-306273
paul s-306273
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2800 Visits: 1135
Two points missed today, but not surprised.
Sean Pearce
Sean Pearce
SSCrazy
SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)SSCrazy (2.2K reputation)

Group: General Forum Members
Points: 2246 Visits: 3433
The question is not quite right. Fragmentation can be removed by running this because the table is rebuilt.

Your claim that Paul says you can't remove fragmentation is wrong. Paul doesn't say you can't do it, he says don't do it.

If you think you can use ALTER TABLE … REBUILD in SQL Server 2008 to fix heap fragmentation, you can, but it causes all the nonclustered indexes to be rebuilt as the heap record locations obviously change.




The SQL Guy @ blogspot

@SeanPearceSQL

About Me
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSChampion
SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)SSChampion (11K reputation)

Group: General Forum Members
Points: 11176 Visits: 7327
Interesting question, thanks Igor

The impact of using ALTER TABLE ... REBUILD compared to DBCC SHRINKFILE OR DBCC SHRINKDB

all those side-effects (shudder)...

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Louis Hillebrand
Louis Hillebrand
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1706 Visits: 3382
A rarely use heaps, but did some research before answering and found my answer on this page http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c6783244-c558-4a23-8ce4-520ce4a87033/meaning-of-index-fragmentation-return-for-heap-tables?forum=sqldatabaseengine and got the answer "wrong"..
pmadhavapeddi22
pmadhavapeddi22
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1670 Visits: 1870
yahoo.... i got it right..

I have created a heap table and inserted data 50,00,000 records and then deleted

Observed the below points


1. page count is reduced before and after the rebuild statement , that implies tables is compressed and rebuilt

2. but found fragmentation is increased.

It took some time to select 4 w00t

finally, I did it right
Raghavendra Mudugal
Raghavendra Mudugal
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2544 Visits: 2958
Thank for the post, very interesting one.

(Out of 4, I got 2 correct, but learnt a lot today) :-)

ww; Raghu
--
The first and the hardest SQL statement I have wrote- "select * from customers" - and I was happy and felt smart.
free_mascot
free_mascot
SSCarpal Tunnel
SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)SSCarpal Tunnel (4.8K reputation)

Group: General Forum Members
Points: 4833 Visits: 2248
Good question, Igor. Enjoyed diging the inromation and basics.

---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
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