-
Notifications
You must be signed in to change notification settings - Fork 15
Description
@AndrewCLion suggests:
Great script but it recommends removing statistics that are not completely overlapping. If the "overlapped" statistic is a filtered index then the script will recommend removing the auto generated statistic but the statistic will then be auto-recreated again.
Adding " AND S.has_filter = 0" to the last where clause fixes this in a "sledgehammer" way.
Thanks, @AndrewCLion .
@VitalyBruk this is your script, please fix it as per Andrew's suggestion: https://github.com/MadeiraData/microsoft-dbas-club/blob/master/Health%20Check%20Scripts/Find%20overlapped%20statistics%20%2B%20DROP%20statement.sql
You can use this script for Redundant Indexes as reference as it is a similar use case: https://github.com/MadeiraData/microsoft-dbas-club/blob/master/Best%20Practices%20Checklists/Redundant%20Indexes%20Detailed.sql#L89
NOTE: This issue is a continuation of an identical issue on the old repository: MadeiraData/MadeiraToolbox#6