|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: 2 days ago @ 9:41 AM
Points: 80,
Visits: 248
|
|
Ive got a large transactional table. its has a clustered index on the 'rowID' column (bigint), which is in great shape (as data isnt ever deleted from the db, but thats another issue for another day).
the non-clustered index on 'fkId' and 'trnDate' is horribly fragmented, at ~90%.
I rebuild it, and the resulting fragmentation is still ~90%. I tried again adjusting the fill-factor and its higher yet. interesting, and the table DOES have 4 'bigint' columns in it. pages show avg free space of 789Kb (which is about 10%, so good to work with)
I am getting this from dm_db_index_physical_Stats, and comparing with results of dbcc showcontig. for good measure I ran a dbcc updateusage (which I know I shouldnt need on sql 2008, but...)
everything I've searched on along these lines leads me to generic stuff about tables with few pages, (this one has over 200k pages) and not quite what im after.
any useful links or tips?
thanks in advance!
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 5:54 AM
Points: 37,726,
Visits: 29,985
|
|
How many pages does the nonclustered index have?
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: 2 days ago @ 9:41 AM
Points: 80,
Visits: 248
|
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Sunday, May 19, 2013 8:09 AM
Points: 1,558,
Visits: 1,396
|
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: 2 days ago @ 9:41 AM
Points: 80,
Visits: 248
|
|
DECLARE @db_id SMALLINT; DECLARE @object_id INT; SET @db_id = DB_ID(N'dbName'); SET @object_id = OBJECT_ID(N'tableName'); IF @object_id IS NULL BEGIN; PRINT N'Invalid object'; END; ELSE BEGIN; SELECT * FROM sys.dm_db_index_physical_stats(@db_id, @object_id, 11, NULL , 'LIMITED'); END; GO
database_id object_id index_id partition_number index_type_desc alloc_unit_type_desc index_depth index_level avg_fragmentation_in_percent fragment_count avg_fragment_size_in_pages page_count avg_page_space_used_in_percent 5 1963870063 11 1 NONCLUSTERED INDEX IN_ROW_DATA 4 0 94.0136877112937 206272 1.05830165994415 218298 NULL
edit: heres a link ot the screenshot, thats impossible to read http://bit.ly/WdEMNW
thanks! :)
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: 2 days ago @ 9:41 AM
Points: 80,
Visits: 248
|
|
for giggles, I rebuilt with a 50% fill factor:
avg_fragmentation_in_percent changed to 94.691... Fragment_count up to 380190 avg_fragment_size_in_pages a touch over 1.03 and page_count is up (as expected) to 394577
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 5:54 AM
Points: 37,726,
Visits: 29,985
|
|
You have autoshrink on by any chance?
btw, you can attach images to the posts. I'm not clicking on an obfuscated link that could go anywhere.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: 2 days ago @ 9:41 AM
Points: 80,
Visits: 248
|
|
its a link to my dropbox, but understand your hesitation. dont have another place handy to stick that image at the moment, so sorry...
I DO NOT have auto-shrink enabled. (just double checked to be positive, whew!)
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Sunday, May 19, 2013 8:09 AM
Points: 1,558,
Visits: 1,396
|
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 5:54 AM
Points: 37,726,
Visits: 29,985
|
|
LAW1143 (1/22/2013) its a link to my dropbox, but understand your hesitation. dont have another place handy to stick that image at the moment, so sorry...
btw, you can attach images to the posts.
Gail Shaw Microsoft Certified Master: SQL Server 2008, MVP SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
We walk in the dark places no others will enter We stand on the bridge and no one may pass
|
|
|
|