-
Notifications
You must be signed in to change notification settings - Fork 8.9k
/
Copy pathruleset.json
20631 lines (20631 loc) · 753 KB
/
ruleset.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"schemaVersion": "1.0",
"name": "Microsoft ruleset",
"version": "1.1.17",
"rules": [
{
"id": "AutoCreateStats",
"itemType": "definition",
"target": {
"type": "Database",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer, ManagedInstance",
"name": {
"not": [
"master",
"msdb",
"tempdb"
]
},
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"Performance",
"Statistics",
"QueryOptimizer"
],
"displayName": "'Auto-Create Statistics' option should be on",
"description": "The Query Optimizer determines whether an index is useful for a specific query by evaluating the stored statistics. If the statistics become out of date and significant changes have occurred against the underlying data, this can result in less than optimal query performance. In most cases, it's best to let SQL Server maintain the statistics. If you turn 'Auto Create Stats' and 'Auto Update Stats' off, then it is up to you to keep the statistics up-to-date somehow. Failure to do so will lead to poor query performance. Most applications should have these options ON. When the Auto Create statistics setting is ON, the Query Optimizer creates statistics on one or more columns of a table or an indexed view, as necessary, to improve query plans and query performance.",
"message": "Turn on 'Auto-Create Statistics' option to improve query performance",
"helpLink": "https://docs.microsoft.com/sql/relational-databases/statistics/statistics#CreateStatistics",
"level": "Medium",
"condition": "@is_auto_create_stats_on",
"probes": [
"DatabaseConfiguration"
]
},
{
"id": "AutoUpdateStats",
"itemType": "definition",
"target": {
"type": "Database",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer, ManagedInstance",
"name": {
"not": [
"master",
"msdb",
"tempdb"
]
},
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"Performance",
"Statistics",
"QueryOptimizer"
],
"displayName": "Auto-Update Statistics should be on",
"description": "The Query Optimizer determines whether an index is useful for a specific query by evaluating the stored statistics. If the statistics become out of date and significant changes have occurred against the underlying data, this can result in less than optimal query performance. In most cases, it's best to let SQL Server maintain the statistics. If you turn 'Auto Create Stats' and 'Auto Update Stats' off, then it is up to you to keep the statistics up-to-date somehow. Failure to do so will lead to poor query performance. Most applications should have these options ON. When the Auto Update Statistics setting is ON, the Query Optimizer updates statistics when they are used by a query and when they might be out-of-date. Statistics become out-of-date after insert, update, delete, or merge operations change the data distribution in the table or indexed view. The Query Optimizer determines when statistics might be out-of-date by counting the number of data modifications since the last statistics update and comparing the number of modifications to a threshold. The threshold is based on the number of rows in the table or indexed view. The Query Optimizer checks for out-of-date statistics before compiling a query and before executing a cached query plan. Before compiling a query, the Query Optimizer uses the columns, tables, and indexed views in the query predicate to determine which statistics might be out-of-date. Before executing a cached query plan, the Database Engine verifies that the query plan references up-to-date statistics. The AUTO_UPDATE_STATISTICS option applies to statistics created for indexes, single-columns in query predicates, and statistics that are created by using the CREATE STATISTICS statement. This option also applies to filtered statistics.",
"message": "Turn on 'Auto-Update Statistics' option to improve query performance",
"helpLink": "https://docs.microsoft.com/sql/relational-databases/statistics/statistics#UpdateStatistics",
"level": "Medium",
"condition": "@is_auto_update_stats_on",
"probes": [
"DatabaseConfiguration"
]
},
{
"id": "QueryStoreOn",
"itemType": "definition",
"target": {
"type": "Database",
"version": "[13.0,)",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer, ManagedInstance",
"name": {
"not": [
"master",
"tempdb",
"model",
"msdb"
]
}
},
"tags": [
"DefaultRuleset",
"Performance",
"QueryStore",
"Statistics"
],
"displayName": "Query Store should be active",
"description": "The Query Store feature provides you with insight on query plan choice and performance. It simplifies performance troubleshooting by helping you quickly find performance differences caused by query plan changes. Query Store automatically captures a history of queries, plans, and runtime statistics, and retains these for your review. It separates data by time windows so you can see database usage patterns and understand when query plan changes happened on the server. While Query Store collects queries, execution plans and statistics, its size in the database grows until this limit is reached. When that happens, Query Store automatically changes the operation mode to read-only and stops collecting new data, which means that your performance analysis is no longer accurate.",
"message": "Query Store operation mode should be 'Read Write' to keep performance analysis accurate",
"helpLink": "https://docs.microsoft.com/sql/relational-databases/performance/monitoring-performance-by-using-the-query-store",
"condition": {
"equal": [
"@query_store_state",
2
]
},
"probes": [
"DatabaseConfiguration"
]
},
{
"id": "TF174",
"itemType": "definition",
"target": {
"type": "Server",
"version": [
"[11.0.3368,12.0)",
"[12.0.2480,13.0)",
"[13.0,)"
],
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Memory",
"Performance"
],
"displayName": "TF 174 increases plan cache bucket count",
"description": "Trace Flag 174 increases the SQL Server plan cache bucket count from 40,009 to 160,001 on 64-bit systems. When the SQL Server plan cache reaches its entry limit, plans that have low cost must be evicted in order to insert new plans. This can cause severe contention on the SOS_CACHESTORE spinlock and a high CPU usage occurs in SQL Server. On 64-bit systems, the number of buckets for the SQL Server plan cache is 40,009. Therefore, the maximum number of entries that can fit inside the SQL Server plan cache is 160,036. Enabling trace flag 174 on high performance systems increases the size of the cache and can avoid SOS_CACHESTORE spinlock contention.",
"message": "Enable trace flag 174 to increase plan cache bucket count",
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
"level": "Information",
"condition": {
"in": [
174,
"@TraceFlag"
]
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF634",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Memory",
"Performance",
"ColumnStore"
],
"displayName": "TF 634 disables background columnstore compression",
"description": "Trace Flag 634 disables the background columnstore compression task. SQL Server periodically runs the Tuple Mover background task that compresses columnstore index rowgroups with uncompressed data, one such rowgroup at a time. Columnstore compression improves query performance but also consumes system resources. You can control the timing of columnstore compression manually, by disabling the background compression task with trace flag 634, and then explicitly invoking ALTER INDEX...REORGANIZE or ALTER INDEX...REBUILD at the time of your choice.",
"message": "Trace flag 634 disables background columnstore compression task. Check if you need to set non-default trace flag with current system build and configuration",
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
"level": "Information",
"condition": {
"not": {
"in": [
634,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF652",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Performance",
"Memory",
"Pages"
],
"displayName": "TF 652 disables page pre-fetching scans",
"description": "Trace Flag 652 disables page pre-fetching for scans. The read-ahead process reads the full extent of a referenced database page into the buffer pool, before those contiguous database pages are consumed by scans. Enabling the trace flag can lead to performance issues on queries that leverage pre-fetching.",
"message": "Trace flag 652 disables page pre-fetching scans. Check if you need to set non-default trace flag with current system build and configuration",
"helpLink": "http://support.microsoft.com/kb/920093",
"level": "Information",
"condition": {
"not": {
"in": [
652,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF661",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Performance"
],
"displayName": "TF 661 disables background ghost cleanup task",
"description": "Trace Flag 661 disables the ghost record removal process. A ghost record is the result of a delete operation. When you delete a record, the deleted record is kept as a ghost record. Later, the deleted record is purged by the ghost record removal process. When you disable this process, the deleted record is not purged. Therefore, the space that the deleted record consumes is not freed. This behavior affects space consumption and the performance of scan operations. If you turn off this trace Flag, the ghost record removal process works correctly.",
"message": "Check if you need to set non-default trace flag with current system build and configuration",
"helpLink": "https://support.microsoft.com/help/920093",
"level": "Information",
"condition": {
"not": {
"in": [
661,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF834",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Performance",
"Memory",
"ColumnStore"
],
"displayName": "TF 834 enables large-page allocations",
"description": "Trace Flag 834 causes the server to use large-page memory (LPM) model for the buffer pool allocations. Consider enabling TF 834 if you have a server that has a lot of memory, particularly for an analytical or data warehousing workload. Trace flag 834 is NOT recommended on SQL Server instances that use columnstore indexes.",
"message": "Enable trace flag 834 to use large-page allocations to improve analytical and data warehousing workloads",
"helpLink": "https://support.microsoft.com/kb/3210239",
"level": "Information",
"condition": {
"or": [
"@ColumnStoreIndexCount",
{
"in": [
834,
"@TraceFlag"
]
}
]
},
"probes": [
"EnabledGlobalTraceFlags",
{
"id": "ServerDatabasesProperties",
"transform": {
"type": "aggregate",
"map": {
"ColumnStoreIndexCount": "sum"
}
}
}
]
},
{
"id": "TF845",
"itemType": "definition",
"target": {
"type": "Server",
"version": "[11.0,)",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Memory",
"Performance"
],
"displayName": "TF 845 is not needed in SQL Server 2012 and higher",
"description": "Trace Flag 845 supports locking pages in memory in SQL Server Standard edition, which is needed together with trace flag 834 to use the large-page memory (LPM) model for the buffer pool allocations. Starting with SQL Server 2012 this behavior is enabled by default for Standard edition, and trace flag 845 must not be used.",
"message": "Disable trace flag 845 in SQL Server 2012 and higher versions",
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
"condition": {
"not": {
"in": [
845,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF902",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"UpdateIssues"
],
"displayName": "TF 902 Database Upgrade Bypass should be disabled",
"description": "Trace Flag 902 bypasses execution of database upgrade script when installing a Cumulative Update or Service Pack. This trace flag is not supported to run it continuously in a production environment. If you encounter an error during script upgrade mode, it is recommended to contact Microsoft SQL Customer Service and Support (CSS) for further guidance.",
"message": "Disable trace flag 902 which bypasses database upgrade",
"helpLink": "https://support.microsoft.com/help/2163980",
"level": "Medium",
"condition": {
"not": {
"in": [
902,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF1117",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"DBFileConfiguration",
"Performance"
],
"displayName": "TF 1117 enables filegroup-level autogrow",
"description": "Trace Flag 1117 initiates the growth of every file in the filegroup, when a file in the filegroup meets the autogrow threshold, and together with trace flag 1118, can help reduce allocation contention in the SQL Server TempDB database. This trace flag affects all databases and is recommended only if every database is safe to be grow all files in a filegroup by the same amount.",
"message": "Enable trace flag 1117 to enable filegroup auto-grow",
"helpLink": "https://support.microsoft.com/help/2154845",
"level": "Information",
"condition": {
"in": [
1117,
"@TraceFlag"
]
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF1117",
"itemType": "override",
"targetFilter": {
"version": "[13.0,)"
},
"displayName": "TF 1117 has no effect in SQL Server 2016 and higher",
"description": "Trace Flag 1117 initiates the growth of every file in the filegroup, when a file in the filegroup meets the autogrow threshold, and together with trace flag 1118, can help reduce allocation contention in the SQL Server TempDB database. Starting with SQL Server 2016, this behavior is controlled by the AUTOGROW_SINGLE_FILE and AUTOGROW_ALL_FILES options of ALTER DATABASE syntax.",
"message": "Disable trace flag 1117 in SQL Server 2016 and higher versions",
"helpLink": "https://docs.microsoft.com/sql/t-sql/statements/alter-database-transact-sql-file-and-filegroup-options",
"condition": {
"not": {
"in": [
1117,
"@TraceFlag"
]
}
}
},
{
"id": "TF1118",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Memory",
"Performance",
"Pages"
],
"displayName": "TF 1118 disables single page allocations",
"description": "Trace Flag 1118 forces page allocations on uniform extents instead of mixed extents, and together with trace flag 1117, can help reduce allocation contention in the SQL Server TempDB database. When a new object is created, by default, the first eight pages are allocated from different extents (mixed extents). Afterwards, when more pages are needed, those are allocated from that same extent (uniform extent). The SGAM page is used to track these mixed extents, so can quickly become a bottleneck when numerous mixed page allocations are occurring. This trace flag allocates all eight pages from the same extent when creating new objects, minimizing the need to scan the SGAM page and forces uniform extent allocations instead of mixed page allocations.",
"message": "Enable trace flag 1118 to force page allocations on uniform extents",
"helpLink": "https://support.microsoft.com/help/328551",
"level": "Information",
"condition": {
"in": [
1118,
"@TraceFlag"
]
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF1118",
"itemType": "override",
"targetFilter": {
"version": "[13.0,)"
},
"displayName": "TF 1118 has no effect in SQL Server 2016 and higher",
"description": "Trace Flag 1118 forces page allocations on uniform extents instead of mixed extents, and together with trace flag 1117, can help reduce allocation contention in the SQL Server TempDB database. When a new object is created, by default, the first eight pages are allocated from different extents (mixed extents). Afterwards, when more pages are needed, those are allocated from that same extent (uniform extent). The SGAM page is used to track these mixed extents, so can quickly become a bottleneck when numerous mixed page allocations are occurring. This trace flag allocates all eight pages from the same extent when creating new objects, minimizing the need to scan the SGAM page and forces uniform extent allocations instead of mixed page allocations. Starting with SQL Server 2016, this behavior is controlled by the SET MIXED_PAGE_ALLOCATION option of ALTER DATABASE syntax.",
"message": "Disable trace flag 1118 in SQL Server 2016 and higher versions",
"helpLink": "https://docs.microsoft.com/sql/t-sql/statements/alter-database-transact-sql-file-and-filegroup-options",
"condition": {
"not": {
"in": [
1118,
"@TraceFlag"
]
}
}
},
{
"id": "TF1204",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Locks",
"Performance"
],
"displayName": "TF 1204 returns deadlock information",
"description": "Trace Flag 1204 returns the resources and types of locks that are participating in a deadlock, including the affected command. The resulting information is recorded in the SQL Server Errorlog.",
"message": "Disable trace flag 1204 that returns deadlock information",
"helpLink": "https://support.microsoft.com/help/832524",
"level": "Information",
"condition": {
"not": {
"in": [
1204,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF1211",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Locks",
"Performance"
],
"displayName": "TF 1211 lock escalation should be disabled",
"description": "Trace Flag 1211 disables lock escalation based on memory pressure, or based on number of locks. Because SQL Server will not escalate row or page locks to table locks, this can generate an excessive number of locks. If the lock memory grows large enough, attempts to allocate additional locks for any query may fail and cause performance issues. This trace flag should not be used in order to avoid inability to allocate lock resources because of insufficient memory. If lock escalation needs to be disabled, use trace flag 1224 instead.",
"message": "Disable trace flag 1211 to enable lock escalation",
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
"level": "Medium",
"condition": {
"not": {
"in": [
1211,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF1222",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Locks",
"Performance"
],
"displayName": "TF 1222 returns deadlock information",
"description": "Trace Flag 1222 returns the resources and types of locks that are participating in a deadlock, including the affected command. The resulting information is recorded in the SQL Server Errorlog, in XML format that does not comply with any XSD schema.",
"message": "Disable trace flag 1222 that returns deadlock information",
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
"level": "Information",
"condition": {
"not": {
"in": [
1222,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF1224",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Locks",
"Performance"
],
"displayName": "TF 1224 should be disabled",
"description": "Trace Flag 1224 disables lock escalation based on the number of locks, unless SQL Server is under memory pressure. Because SQL Server will not escalate row or page locks to table locks, this can generate an excessive number of locks.",
"message": "Disable trace flag 1224 to allow lock escalation",
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
"level": "Medium",
"condition": {
"not": {
"in": [
1224,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF1229",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Locks",
"Performance",
"CPU"
],
"displayName": "TF 1229 lock partitioning should be enabled",
"description": "Trace Flag 1229 disables lock partitioning regardless of the number of CPUs. By default, SQL Server enables lock partitioning when a server has 16 or more CPUs, to improve the scalability characteristics of larger systems. Disabling lock partitioning may cause can cause spinlock contention and poor performance, or unexpected behaviors when switching partitions.",
"message": "Disable trace flag 1229 to enable lock partitioning",
"helpLink": "https://docs.microsoft.com/sql/relational-databases/sql-server-transaction-locking-and-row-versioning-guide",
"level": "Medium",
"condition": {
"not": {
"in": [
1229,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF1236",
"itemType": "definition",
"target": {
"type": "Server",
"version": "[11.0,)",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Locks",
"Performance"
],
"displayName": "TF 1236 database lock partitioning should be enabled",
"description": "Trace Flag 1236 enables database-level lock partitioning. Lock Partitioning is utilized to improve the scalability characteristics on larger systems.",
"message": "Enable trace Flag 1236 to enable database lock partitioning",
"helpLink": "https://support.microsoft.com/help/2926217",
"level": "Medium",
"condition": {
"in": [
1236,
"@TraceFlag"
]
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF1236",
"itemType": "override",
"targetFilter": {
"version": [
"[11.0.6020,12.0)",
"[12.0.4100,)"
]
},
"displayName": "TF 1236 is not needed in SQL Server 2012 SP3, SQL Server 2014 SP1 and higher",
"description": "Trace Flag 1236 enables database-level lock partitioning. Starting with SQL Server 2012 SP3 and SQL Server 2014 SP1, this behavior is controlled by the engine and trace flag 1236 has no effect.",
"message": "Disable trace flag 1236 in SQL Server 2012 SP3, SQL Server 2014 SP1 and higher versions",
"level": "Low",
"condition": {
"not": {
"in": [
1236,
"@TraceFlag"
]
}
}
},
{
"id": "TF1462",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Performance",
"AvailabilityGroups"
],
"displayName": "TF 1462 should be disabled to allow Log Stream Compression",
"description": "Trace Flag 1462 disables log stream compression for asynchronous availability groups. This feature is enabled by default on asynchronous replicas to optimize network bandwidth.",
"message": "Disable trace flag 1462 to allow log stream compression",
"helpLink": "https://docs.microsoft.com/sql/database-engine/availability-groups/windows/tune-compression-for-availability-group",
"level": "Medium",
"condition": {
"not": {
"in": [
1462,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF2312",
"itemType": "definition",
"target": {
"type": "Server",
"platform": "Windows",
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"QueryOptimizer",
"Performance"
],
"displayName": "TF 2312 sets the default cardinality estimation model",
"description": "Trace Flag 2312 sets the Query Optimizer cardinality estimation model to the default version of the database compability level of SQL Server 2014 and higher versions. If the database compatibility level is lower than 120, enabling trace flag 2312 uses the cardinality estimation model of SQL Server 2014 (120).",
"message": "Trace Flag 2312 does not apply to this SQL Server version. Check if you need to set a non-default trace flag with the current system build and configuration",
"helpLink": "https://support.microsoft.com/help/2801413",
"level": "Low",
"condition": {
"not": {
"in": [
2312,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF2312",
"itemType": "override",
"targetFilter": {
"version": "[12.0, )"
},
"message": "TF2312 sets the query optimizer cardinality estimation model to SQL Server 2014 or above versions, dependent of the compatibility level of the database",
"level": "Information",
"enabled": false
},
{
"id": "TF2330",
"itemType": "definition",
"target": {
"type": "Server",
"version": "[11.0,)",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Performance",
"Indexes"
],
"displayName": "TF 2330 disables recording of index usage stats",
"description": "Trace Flag 2330 disables recording of index usage stats, which could lead to a non-yielding condition in SQL 2005.",
"message": "Check if you need to disable recording of index usage stats by setting non-default trace flag 2330",
"helpLink": "https://blogs.msdn.microsoft.com/ialonso/2012/10/08/faq-around-sys-dm_db_index_usage_stats",
"level": "Low",
"condition": {
"not": {
"in": [
2330,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF2340",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"QueryOptimizer",
"Performance"
],
"displayName": "TF 2340 disables Batch Sorts for optimized nested loops joins",
"description": "Trace Flag 2340 causes SQL Server not to use a sort operation (batch sort) for optimized nested loops joins when generating a plan. Verify need to set a non-default trace flag with the current system build and configuration.",
"message": "Trace Flag 2340 disables Batch Sorts for optimized nested loops joins",
"helpLink": "https://docs.microsoft.com/sql/t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql",
"level": "Information",
"condition": {
"not": {
"in": [
2340,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF2371",
"itemType": "definition",
"target": {
"type": "Server",
"version": "[11.0,)",
"platform": "Windows",
"engineEdition": "SqlServer"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Performance",
"Statistics"
],
"displayName": "TF 2371 enables a linear recompilation threshold for statistics",
"description": "Trace Flag 2371 causes SQL Server to change the fixed update statistics threshold to a linear update statistics threshold. This is especially useful to keep statistics updated on large tables.",
"message": "Enable trace Flag 2371 to allow linear recompilation threshold for statistics",
"helpLink": "https://docs.microsoft.com/sql/relational-databases/statistics/statistics#auto_update_statistics-option",
"level": "Information",
"condition": {
"in": [
2371,
"@TraceFlag"
]
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF2371",
"itemType": "override",
"targetFilter": {
"version": "[13.0,)"
},
"description": "Trace Flag 2371 causes SQL Server to change the fixed update statistics threshold to a linear update statistics threshold. This is especially useful to keep statistics updated on large tables. Starting with SQL Server 2016, for databases using compatibility level 130 and above, this behavior is controlled by the engine and trace flag 2371 has no effect.",
"condition": {
"or": [
{
"ge": [
"@min_compatibility_level",
130
]
},
{
"in": [
2371,
"@TraceFlag"
]
}
]
},
"probes": [
"EnabledGlobalTraceFlags",
"DatabasesAggregates"
]
},
{
"id": "TF2389",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer, ManagedInstance",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Statistics",
"Performance"
],
"displayName": "TF 2389 enables automatic statistics for ascending keys",
"description": "Trace Flag 2389 enables automatically generated quick statistics for ascending keys (histogram amendment). This trace flag is recommended to be set in cases where queries access newly inserted ascending key values (such as an IDENTITY column), but the new values are not yet updated in the statistics histogram for the affected columns. In this case the histogram used to estimate cardinality will be adjusted at query compile time. Verify need to set a non-default trace flag with the current system build and configuration.",
"message": "Check if you need to set non-default trace flag 2389 with current system build and configuration",
"helpLink": "https://support.microsoft.com/help/2801413",
"level": "Information",
"condition": {
"not": {
"in": [
2389,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF2390",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer, ManagedInstance",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",
"TraceFlag",
"Statistics",
"Performance",
"Indexes"
],
"displayName": "TF 2390 enables automatic statistics for Ascending or Unknown Keys",
"description": "Trace Flag 2390 enables automatically generated quick statistics for ascending or unknown keys (histogram amendment). This trace flag is recommended to be set in cases where queries access newly inserted ascending key values (such as an IDENTITY column), but the new values are not yet updated in the statistics histogram for the affected columns. In this case the histogram used to estimate cardinality will be adjusted at query compile time. Verify need to set a non-default trace flag with the current system build and configuration.",
"message": "Trace Flag 2390 enables automatic statistics for ascending or unknown keys. Check if you need to set non-default trace flag with current system build and configuration",
"helpLink": "https://support.microsoft.com/help/2801413",
"level": "Information",
"condition": {
"not": {
"in": [
2390,
"@TraceFlag"
]
}
},
"probes": [
"EnabledGlobalTraceFlags"
]
},
{
"id": "TF2528",
"itemType": "definition",
"target": {
"type": "Server",
"platform": [
"Windows",
"Linux"
],
"engineEdition": "SqlServer",
"version": "[11.0,)"
},
"tags": [
"DefaultRuleset",