I have a table with a clustered index, which shows ~70% fragmentation on a SQL Server 2008 database. I'm trying to rebuild this index:
ALTER INDEX PK_Table1Index ON Table1 REBUILD
The statement returns immediately with success, however the fragmentation is not changing. If I review the fragmentation in the SSMS, it remains the same.
I'm suspicious that it returns immediately, so it seems as if it's not doing anything. Since a clustered index determines the table layout on disk, I'd assume that this would have to be an offline task?
I guess I'm missing something and was hoping somebody could shed some light.
How big is the table?
A small table that is only a few pages/extents rows will always show high fragmentation