SHARE
TWEET

SQL Server Index Fragementation

cbossie Mar 19th, 2020 (edited) 217 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select
  2.     a.index_id,
  3.     OBJECT_NAME(b.object_id) as object,
  4.     name,
  5.     avg_fragmentation_in_percent as frag,
  6.     fragment_count,
  7.     avg_fragment_size_in_pages,
  8.     *
  9. from
  10.     sys.dm_db_index_physical_stats (DB_ID('Pricing'), null, NULL, NULL, NULL) as a
  11. INNER join
  12.     sys.indexes as b on
  13.     a.object_id = b.object_id and
  14.     a.index_id = b.index_id
  15. ORDER BY
  16.     frag DESC
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top