When we perform any data modification operations (INSERT, UPDATE, or DELETE statements) table fragmentation can occur. When changes are made to the data that affect the index, index fragmentation can occur and the information in the index can get scattered in the database. Fragmented data can cause SQL Server to perform unnecessary data reads, so a queries performance against a heavy fragmented table can be very poor. If you want to determine the level of fragmentation, you can use theDBCC SHOWCONTIGstatement. The DBCC SHOWCONTIGstatement displays fragmentation information for the data and indexes of the specified table or view.
Index fragmentation is a phenomena where index contents are no longer stored continuously in the storage. When index contents become scattered in the storage, fragmented, performance on index will degrade. If you want to see the fragmentation level of an index, you can use the system function called sys.dm_db_indephysical_stats() in the following format: SELECT * FROM sys.dm_db_indephysical_stats( database_id, table_id, indeid, DEFAULT, DEFAULT )
Join MindStick Community
You need to log in or register to vote on answers or questions.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
If you want to see the fragmentation level of an index, you can use the system function called sys.dm_db_indephysical_stats() in the following format:
SELECT * FROM sys.dm_db_indephysical_stats(
database_id, table_id, indeid, DEFAULT, DEFAULT )