Changes for page index-maintenance

Last modified by Gideon Lombard on 2023/05/22 23:50

<
From version < 6.1 >
edited by Rudi Marais
on 2022/02/10 15:34
To version < 2.1 >
edited by Rudi Marais
on 2022/02/10 15:30
>
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -30,11 +30,8 @@
30 30  
31 31  {{code language="sql"}}
32 32  
33 ---// https://www.sqlshack.com/how-to-identify-and-monitor-unused-indexes-in-sql-server/
34 -
35 35  SELECT
36 - schema_name(objects.schema_id) schema_name,
37 - objects.name AS Table_name,
34 + objects.name AS Table_name,
38 38   indexes.name AS Index_name,
39 39   dm_db_index_usage_stats.user_seeks,
40 40   dm_db_index_usage_stats.user_scans,
... ... @@ -46,7 +46,7 @@
46 46  WHERE
47 47   indexes.is_primary_key = 0 --This line excludes primary key constarint
48 48   AND
49 - indexes.is_unique = 0 --This line excludes unique key constarint
46 + indexes. is_unique = 0 --This line excludes unique key constarint
50 50   AND
51 51   dm_db_index_usage_stats.user_updates <> 0 -- This line excludes indexes SQL Server hasn’t done any work with
52 52   AND

Need help?

If you need help with XWiki you can contact: