Skip to content

Commit

Permalink
Re yochananrachamim#39 - Ignore External Tables
Browse files Browse the repository at this point in the history
Fix for ignoring TVFs
  • Loading branch information
alasdaircs committed Oct 31, 2023
1 parent 7f7451c commit d9f28a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion AzureSQLMaintenance.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ begin
and (alloc_unit_type_desc = 'IN_ROW_DATA' /*avoid LOB_DATA or ROW_OVERFLOW_DATA*/ or alloc_unit_type_desc is null /*for ColumnStore indexes*/)
and OBJECT_SCHEMA_NAME(idxs.object_id) != 'sys'
and idxs.is_disabled=0
and obj.type_desc != 'TF' /* Ignore table value functions */
and obj.type <> 'TF' /* Ignore table value functions */
and not exists ( select * from sys.external_tables as et where et.object_id = obj.object_id )
order by i.avg_fragmentation_in_percent desc, i.page_count desc

-- mark indexes XML,spatial and columnstore not to run online update
Expand Down

0 comments on commit d9f28a3

Please sign in to comment.