Skip to content

Commit

Permalink
latest comments, removed filters by default
Browse files Browse the repository at this point in the history
  • Loading branch information
williamadba committed Nov 29, 2018
1 parent 2e9ef6a commit 5a255c0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions defrag.sql
Expand Up @@ -39,12 +39,13 @@ FROM ( SELECT
GROUP BY x.DB , x.[schema_name] , x.[table_name]

HAVING 1=1
AND SUM(page_count) > 1280 --1280 pages is 10mb, ignore anything smaller
AND AVG(avg_fragmentation_pct) > 50
--AND SUM(page_count) > 1280 --1280 pages is 10mb, ignore anything smaller
--AND AVG(avg_fragmentation_pct) > 50

ORDER BY SUM(page_count) desc, AVG(avg_fragmentation_pct) desc;

/*
ALTER INDEX ALL ON SPARK.dbo.GL20000 REBUILD WITH (SORT_IN_TEMPDB = ON);
ALTER INDEX ALL ON SPARK.dbo.RM10101 REBUILD WITH (SORT_IN_TEMPDB = ON);
*/

0 comments on commit 5a255c0

Please sign in to comment.