Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Optimizing deletion in batch
Message
De
07/01/2014 15:02:56
 
 
À
07/01/2014 14:31:29
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01591061
Message ID:
01591468
Vues:
48
This message has been marked as a message which has helped to the initial question of the thread.
J'aime (1)
OK, let's start here - let's get the fragmentation level of your tables/indexes.

Go ahead and run this code.....

Note at the bottom I put a where condition on - to get the frag levels for a single table. So you can filter on a table, or just omit the where clause and get the frag level for all tables.

Let me know the column values for the table(s) in question. Anything over about 30% means the table should be reindexed, and anything well over 50% can definitely be an indicator of sluggish performance. If all the numbers on your major tables are under 30% then the problem is likely elsewhere.
SELECT OBJECT_NAME([OBJECT_ID])  AS TableName,   
       avg_fragmentation_in_percent AS Fragmentation,
       fragment_count, page_count
       FROM sys.dm_db_index_physical_stats
            (DB_ID(), null, null, null, null)
            where OBJECT_NAME([OBJECT_ID]) = 'PurchaseOrderHeader' 
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform