Table fragmentation in SQL Server 2008 ?

  • Hi Guys,

    We had a table with 800 million rows in that and recently with the archiving project we got rid of around 500 million rows from that table. I know that we can take care of index fragmentation by rebuilding but not sure if there will a table level fragmentation and how can we take care of that.

    Any insight will be highly appreciated!

    Thanks,

    Deep

  • Does the table have a clustered index? If so rebuild the clustered index.

    If not, you cannot resolve table fragmentation until a clustered index has been created.

    I stand corrected on Adi's post, didnt know about the ALTER TABLE .... REBUILD option.

  • Rebuilding the clustered index rebuilds the whole table. If the table is a heap you can rebuild the table with alter table statement (but most chances are that creating a clustered index will be better).

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Yes, Table has a clustered index and we did rebuild the index so I think we are good. Thanks for the help.

    Thanks,

    Deep

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply