-
Notifications
You must be signed in to change notification settings - Fork 5.9k
/
Copy pathtidb_vars.go
1112 lines (914 loc) · 59.5 KB
/
tidb_vars.go
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
// Copyright 2017 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package variable
import (
"math"
"github.com/pingcap/tidb/config"
"github.com/pingcap/tidb/parser/mysql"
"github.com/pingcap/tidb/sessionctx/variable/featuretag/concurrencyddl"
"github.com/pingcap/tidb/util/paging"
"github.com/pingcap/tidb/util/size"
"go.uber.org/atomic"
)
/*
Steps to add a new TiDB specific system variable:
1. Add a new variable name with comment in this file.
2. Add the default value of the new variable in this file.
3. Add SysVar instance in 'defaultSysVars' slice.
*/
// TiDB system variable names that only in session scope.
const (
TiDBDDLSlowOprThreshold = "ddl_slow_threshold"
// TiDBSnapshot is used for reading history data, the default value is empty string.
// The value can be a datetime string like '2017-11-11 20:20:20' or a tso string. When this variable is set, the session reads history data of that time.
TiDBSnapshot = "tidb_snapshot"
// TiDBOptAggPushDown is used to enable/disable the optimizer rule of aggregation push down.
TiDBOptAggPushDown = "tidb_opt_agg_push_down"
// TiDBOptCartesianBCJ is used to disable/enable broadcast cartesian join in MPP mode
TiDBOptCartesianBCJ = "tidb_opt_broadcast_cartesian_join"
TiDBOptMPPOuterJoinFixedBuildSide = "tidb_opt_mpp_outer_join_fixed_build_side"
// TiDBOptDistinctAggPushDown is used to decide whether agg with distinct should be pushed to tikv/tiflash.
TiDBOptDistinctAggPushDown = "tidb_opt_distinct_agg_push_down"
// TiDBOptSkewDistinctAgg is used to indicate the distinct agg has data skew
TiDBOptSkewDistinctAgg = "tidb_opt_skew_distinct_agg"
// TiDBBCJThresholdSize is used to limit the size of small table for mpp broadcast join.
// Its unit is bytes, if the size of small table is larger than it, we will not use bcj.
TiDBBCJThresholdSize = "tidb_broadcast_join_threshold_size"
// TiDBBCJThresholdCount is used to limit the count of small table for mpp broadcast join.
// If we can't estimate the size of one side of join child, we will check if its row number exceeds this limitation.
TiDBBCJThresholdCount = "tidb_broadcast_join_threshold_count"
// TiDBOptWriteRowID is used to enable/disable the operations of insert、replace and update to _tidb_rowid.
TiDBOptWriteRowID = "tidb_opt_write_row_id"
// TiDBAutoAnalyzeRatio will run if (table modify count)/(table row count) is greater than this value.
TiDBAutoAnalyzeRatio = "tidb_auto_analyze_ratio"
// TiDBAutoAnalyzeStartTime will run if current time is within start time and end time.
TiDBAutoAnalyzeStartTime = "tidb_auto_analyze_start_time"
TiDBAutoAnalyzeEndTime = "tidb_auto_analyze_end_time"
// TiDBChecksumTableConcurrency is used to speed up the ADMIN CHECKSUM TABLE
// statement, when a table has multiple indices, those indices can be
// scanned concurrently, with the cost of higher system performance impact.
TiDBChecksumTableConcurrency = "tidb_checksum_table_concurrency"
// TiDBCurrentTS is used to get the current transaction timestamp.
// It is read-only.
TiDBCurrentTS = "tidb_current_ts"
// TiDBLastTxnInfo is used to get the last transaction info within the current session.
TiDBLastTxnInfo = "tidb_last_txn_info"
// TiDBLastQueryInfo is used to get the last query info within the current session.
TiDBLastQueryInfo = "tidb_last_query_info"
// TiDBLastDDLInfo is used to get the last ddl info within the current session.
TiDBLastDDLInfo = "tidb_last_ddl_info"
// TiDBConfig is a read-only variable that shows the config of the current server.
TiDBConfig = "tidb_config"
// TiDBBatchInsert is used to enable/disable auto-split insert data. If set this option on, insert executor will automatically
// insert data into multiple batches and use a single txn for each batch. This will be helpful when inserting large data.
TiDBBatchInsert = "tidb_batch_insert"
// TiDBBatchDelete is used to enable/disable auto-split delete data. If set this option on, delete executor will automatically
// split data into multiple batches and use a single txn for each batch. This will be helpful when deleting large data.
TiDBBatchDelete = "tidb_batch_delete"
// TiDBBatchCommit is used to enable/disable auto-split the transaction.
// If set this option on, the transaction will be committed when it reaches stmt-count-limit and starts a new transaction.
TiDBBatchCommit = "tidb_batch_commit"
// TiDBDMLBatchSize is used to split the insert/delete data into small batches.
// It only takes effort when tidb_batch_insert/tidb_batch_delete is on.
// Its default value is 20000. When the row size is large, 20k rows could be larger than 100MB.
// User could change it to a smaller one to avoid breaking the transaction size limitation.
TiDBDMLBatchSize = "tidb_dml_batch_size"
// The following session variables controls the memory quota during query execution.
// TiDBMemQuotaQuery controls the memory quota of a query.
TiDBMemQuotaQuery = "tidb_mem_quota_query" // Bytes.
// TiDBMemQuotaApplyCache controls the memory quota of a query.
TiDBMemQuotaApplyCache = "tidb_mem_quota_apply_cache"
// TiDBGeneralLog is used to log every query in the server in info level.
TiDBGeneralLog = "tidb_general_log"
// TiDBLogFileMaxDays is used to log every query in the server in info level.
TiDBLogFileMaxDays = "tidb_log_file_max_days"
// TiDBPProfSQLCPU is used to add label sql label to pprof result.
TiDBPProfSQLCPU = "tidb_pprof_sql_cpu"
// TiDBRetryLimit is the maximum number of retries when committing a transaction.
TiDBRetryLimit = "tidb_retry_limit"
// TiDBDisableTxnAutoRetry disables transaction auto retry.
TiDBDisableTxnAutoRetry = "tidb_disable_txn_auto_retry"
// TiDBEnableChunkRPC enables TiDB to use Chunk format for coprocessor requests.
TiDBEnableChunkRPC = "tidb_enable_chunk_rpc"
// TiDBOptimizerSelectivityLevel is used to control the selectivity estimation level.
TiDBOptimizerSelectivityLevel = "tidb_optimizer_selectivity_level"
// TiDBOptimizerEnableNewOnlyFullGroupByCheck is used to open the newly only_full_group_by check by maintaining functional dependency.
TiDBOptimizerEnableNewOnlyFullGroupByCheck = "tidb_enable_new_only_full_group_by_check"
TiDBOptimizerEnableOuterJoinReorder = "tidb_enable_outer_join_reorder"
// TiDBTxnMode is used to control the transaction behavior.
TiDBTxnMode = "tidb_txn_mode"
// TiDBRowFormatVersion is used to control tidb row format version current.
TiDBRowFormatVersion = "tidb_row_format_version"
// TiDBEnableTablePartition is used to control table partition feature.
// The valid value include auto/on/off:
// on or auto: enable table partition if the partition type is implemented.
// off: always disable table partition.
TiDBEnableTablePartition = "tidb_enable_table_partition"
// TiDBEnableListTablePartition is used to control list table partition feature.
TiDBEnableListTablePartition = "tidb_enable_list_partition"
// TiDBSkipIsolationLevelCheck is used to control whether to return error when set unsupported transaction
// isolation level.
TiDBSkipIsolationLevelCheck = "tidb_skip_isolation_level_check"
// TiDBLowResolutionTSO is used for reading data with low resolution TSO which is updated once every two seconds
TiDBLowResolutionTSO = "tidb_low_resolution_tso"
// TiDBReplicaRead is used for reading data from replicas, followers for example.
TiDBReplicaRead = "tidb_replica_read"
// TiDBAdaptiveClosestReadThreshold is for reading data from closest replicas(with same 'zone' label).
// TiKV client should send read request to the closest replica(leader/follower) if the estimated response
// size exceeds this threshold; otherwise, this request should be sent to leader.
// This variable only take effect when `tidb_replica_read` is 'closest-adaptive'.
TiDBAdaptiveClosestReadThreshold = "tidb_adaptive_closest_read_threshold"
// TiDBAllowRemoveAutoInc indicates whether a user can drop the auto_increment column attribute or not.
TiDBAllowRemoveAutoInc = "tidb_allow_remove_auto_inc"
// TiDBMultiStatementMode enables multi statement at the risk of SQL injection
// provides backwards compatibility
TiDBMultiStatementMode = "tidb_multi_statement_mode"
// TiDBEvolvePlanTaskMaxTime controls the max time of a single evolution task.
TiDBEvolvePlanTaskMaxTime = "tidb_evolve_plan_task_max_time"
// TiDBEvolvePlanTaskStartTime is the start time of evolution task.
TiDBEvolvePlanTaskStartTime = "tidb_evolve_plan_task_start_time"
// TiDBEvolvePlanTaskEndTime is the end time of evolution task.
TiDBEvolvePlanTaskEndTime = "tidb_evolve_plan_task_end_time"
// TiDBSlowLogThreshold is used to set the slow log threshold in the server.
TiDBSlowLogThreshold = "tidb_slow_log_threshold"
// TiDBRecordPlanInSlowLog is used to log the plan of the slow query.
TiDBRecordPlanInSlowLog = "tidb_record_plan_in_slow_log"
// TiDBEnableSlowLog enables TiDB to log slow queries.
TiDBEnableSlowLog = "tidb_enable_slow_log"
// TiDBCheckMb4ValueInUTF8 is used to control whether to enable the check wrong utf8 value.
TiDBCheckMb4ValueInUTF8 = "tidb_check_mb4_value_in_utf8"
// TiDBFoundInPlanCache indicates whether the last statement was found in plan cache
TiDBFoundInPlanCache = "last_plan_from_cache"
// TiDBFoundInBinding indicates whether the last statement was matched with the hints in the binding.
TiDBFoundInBinding = "last_plan_from_binding"
// TiDBAllowAutoRandExplicitInsert indicates whether explicit insertion on auto_random column is allowed.
TiDBAllowAutoRandExplicitInsert = "allow_auto_random_explicit_insert"
// TiDBTxnScope indicates whether using global transactions or local transactions.
TiDBTxnScope = "txn_scope"
// TiDBTxnReadTS indicates the next transaction should be staleness transaction and provide the startTS
TiDBTxnReadTS = "tx_read_ts"
// TiDBReadStaleness indicates the staleness duration for following statement
TiDBReadStaleness = "tidb_read_staleness"
// TiDBEnablePaging indicates whether paging is enabled in coprocessor requests.
TiDBEnablePaging = "tidb_enable_paging"
// TiDBReadConsistency indicates whether the autocommit read statement goes through TiKV RC.
TiDBReadConsistency = "tidb_read_consistency"
// TiDBSysdateIsNow is the name of the `tidb_sysdate_is_now` system variable
TiDBSysdateIsNow = "tidb_sysdate_is_now"
// RequireSecureTransport indicates the secure mode for data transport
RequireSecureTransport = "require_secure_transport"
// TiFlashFastScan indicates whether use fast scan in tiflash.
TiFlashFastScan = "tiflash_fastscan"
// TiDBEnableTiFlashReadForWriteStmt indicates whether to enable TiFlash to read for write statements.
TiDBEnableTiFlashReadForWriteStmt = "tidb_enable_tiflash_read_for_write_stmt"
)
// TiDB system variable names that both in session and global scope.
const (
// TiDBBuildStatsConcurrency is used to speed up the ANALYZE statement, when a table has multiple indices,
// those indices can be scanned concurrently, with the cost of higher system performance impact.
TiDBBuildStatsConcurrency = "tidb_build_stats_concurrency"
// TiDBDistSQLScanConcurrency is used to set the concurrency of a distsql scan task.
// A distsql scan task can be a table scan or a index scan, which may be distributed to many TiKV nodes.
// Higher concurrency may reduce latency, but with the cost of higher memory usage and system performance impact.
// If the query has a LIMIT clause, high concurrency makes the system do much more work than needed.
TiDBDistSQLScanConcurrency = "tidb_distsql_scan_concurrency"
// TiDBOptInSubqToJoinAndAgg is used to enable/disable the optimizer rule of rewriting IN subquery.
TiDBOptInSubqToJoinAndAgg = "tidb_opt_insubq_to_join_and_agg"
// TiDBOptPreferRangeScan is used to enable/disable the optimizer to always prefer range scan over table scan, ignoring their costs.
TiDBOptPreferRangeScan = "tidb_opt_prefer_range_scan"
// TiDBOptEnableCorrelationAdjustment is used to indicates if enable correlation adjustment.
TiDBOptEnableCorrelationAdjustment = "tidb_opt_enable_correlation_adjustment"
// TiDBOptLimitPushDownThreshold determines if push Limit or TopN down to TiKV forcibly.
TiDBOptLimitPushDownThreshold = "tidb_opt_limit_push_down_threshold"
// TiDBOptCorrelationThreshold is a guard to enable row count estimation using column order correlation.
TiDBOptCorrelationThreshold = "tidb_opt_correlation_threshold"
// TiDBOptCorrelationExpFactor is an exponential factor to control heuristic approach when tidb_opt_correlation_threshold is not satisfied.
TiDBOptCorrelationExpFactor = "tidb_opt_correlation_exp_factor"
// TiDBOptCPUFactor is the CPU cost of processing one expression for one row.
TiDBOptCPUFactor = "tidb_opt_cpu_factor"
// TiDBOptCopCPUFactor is the CPU cost of processing one expression for one row in coprocessor.
TiDBOptCopCPUFactor = "tidb_opt_copcpu_factor"
// TiDBOptTiFlashConcurrencyFactor is concurrency number of tiflash computation.
TiDBOptTiFlashConcurrencyFactor = "tidb_opt_tiflash_concurrency_factor"
// TiDBOptNetworkFactor is the network cost of transferring 1 byte data.
TiDBOptNetworkFactor = "tidb_opt_network_factor"
// TiDBOptScanFactor is the IO cost of scanning 1 byte data on TiKV.
TiDBOptScanFactor = "tidb_opt_scan_factor"
// TiDBOptDescScanFactor is the IO cost of scanning 1 byte data on TiKV in desc order.
TiDBOptDescScanFactor = "tidb_opt_desc_factor"
// TiDBOptSeekFactor is the IO cost of seeking the start value in a range on TiKV or TiFlash.
TiDBOptSeekFactor = "tidb_opt_seek_factor"
// TiDBOptMemoryFactor is the memory cost of storing one tuple.
TiDBOptMemoryFactor = "tidb_opt_memory_factor"
// TiDBOptDiskFactor is the IO cost of reading/writing one byte to temporary disk.
TiDBOptDiskFactor = "tidb_opt_disk_factor"
// TiDBOptConcurrencyFactor is the CPU cost of additional one goroutine.
TiDBOptConcurrencyFactor = "tidb_opt_concurrency_factor"
// TiDBOptForceInlineCTE is used to enable/disable inline CTE
TiDBOptForceInlineCTE = "tidb_opt_force_inline_cte"
// Variables for the Cost Model Ver2
// TiDBOptCPUFactorV2 is the CPU factor for the Cost Model Ver2
TiDBOptCPUFactorV2 = "tidb_opt_cpu_factor_v2"
// TiDBOptCopCPUFactorV2 is the CopCPU factor for the Cost Model Ver2
TiDBOptCopCPUFactorV2 = "tidb_opt_copcpu_factor_v2"
// TiDBOptTiFlashCPUFactorV2 is the TiFlashCPU factor for the Cost Model Ver2
TiDBOptTiFlashCPUFactorV2 = "tidb_opt_tiflash_cpu_factor_v2"
// TiDBOptNetworkFactorV2 is the network factor for the Cost Model Ver2
TiDBOptNetworkFactorV2 = "tidb_opt_network_factor_v2"
// TiDBOptScanFactorV2 is the scan factor for the Cost Model Ver2
TiDBOptScanFactorV2 = "tidb_opt_scan_factor_v2"
// TiDBOptDescScanFactorV2 is the desc scan factor for the Cost Model Ver2
TiDBOptDescScanFactorV2 = "tidb_opt_desc_factor_v2"
// TiDBOptTiFlashScanFactorV2 is the TiFlashScan factor for the Cost Model Ver2
TiDBOptTiFlashScanFactorV2 = "tidb_opt_tiflash_scan_factor_v2"
// TiDBOptSeekFactorV2 is the seek factor for the Cost Model Ver2
TiDBOptSeekFactorV2 = "tidb_opt_seek_factor_v2"
// TiDBOptMemoryFactorV2 is the memory factor for the Cost Model Ver2
TiDBOptMemoryFactorV2 = "tidb_opt_memory_factor_v2"
// TiDBOptDiskFactorV2 is the disk factor for the Cost Model Ver2
TiDBOptDiskFactorV2 = "tidb_opt_disk_factor_v2"
// TiDBOptConcurrencyFactorV2 is the concurrency factor for the Cost Model Ver2
TiDBOptConcurrencyFactorV2 = "tidb_opt_concurrency_factor_v2"
// TiDBIndexJoinBatchSize is used to set the batch size of an index lookup join.
// The index lookup join fetches batches of data from outer executor and constructs ranges for inner executor.
// This value controls how much of data in a batch to do the index join.
// Large value may reduce the latency but consumes more system resource.
TiDBIndexJoinBatchSize = "tidb_index_join_batch_size"
// TiDBIndexLookupSize is used for index lookup executor.
// The index lookup executor first scan a batch of handles from a index, then use those handles to lookup the table
// rows, this value controls how much of handles in a batch to do a lookup task.
// Small value sends more RPCs to TiKV, consume more system resource.
// Large value may do more work than needed if the query has a limit.
TiDBIndexLookupSize = "tidb_index_lookup_size"
// TiDBIndexLookupConcurrency is used for index lookup executor.
// A lookup task may have 'tidb_index_lookup_size' of handles at maximum, the handles may be distributed
// in many TiKV nodes, we execute multiple concurrent index lookup tasks concurrently to reduce the time
// waiting for a task to finish.
// Set this value higher may reduce the latency but consumes more system resource.
// tidb_index_lookup_concurrency is deprecated, use tidb_executor_concurrency instead.
TiDBIndexLookupConcurrency = "tidb_index_lookup_concurrency"
// TiDBIndexLookupJoinConcurrency is used for index lookup join executor.
// IndexLookUpJoin starts "tidb_index_lookup_join_concurrency" inner workers
// to fetch inner rows and join the matched (outer, inner) row pairs.
// tidb_index_lookup_join_concurrency is deprecated, use tidb_executor_concurrency instead.
TiDBIndexLookupJoinConcurrency = "tidb_index_lookup_join_concurrency"
// TiDBIndexSerialScanConcurrency is used for controlling the concurrency of index scan operation
// when we need to keep the data output order the same as the order of index data.
TiDBIndexSerialScanConcurrency = "tidb_index_serial_scan_concurrency"
// TiDBMaxChunkSize is used to control the max chunk size during query execution.
TiDBMaxChunkSize = "tidb_max_chunk_size"
// TiDBAllowBatchCop means if we should send batch coprocessor to TiFlash. It can be set to 0, 1 and 2.
// 0 means never use batch cop, 1 means use batch cop in case of aggregation and join, 2, means to force sending batch cop for any query.
// The default value is 0
TiDBAllowBatchCop = "tidb_allow_batch_cop"
// TiDBAllowMPPExecution means if we should use mpp way to execute query or not.
// Default value is `true`, means to be determined by the optimizer.
// Value set to `false` means never use mpp.
TiDBAllowMPPExecution = "tidb_allow_mpp"
// TiDBHashExchangeWithNewCollation means if hash exchange is supported when new collation is on.
// Default value is `true`, means support hash exchange when new collation is on.
// Value set to `false` means not support hash exchange when new collation is on.
TiDBHashExchangeWithNewCollation = "tidb_hash_exchange_with_new_collation"
// TiDBEnforceMPPExecution means if we should enforce mpp way to execute query or not.
// Default value is `false`, means to be determined by variable `tidb_allow_mpp`.
// Value set to `true` means enforce use mpp.
// Note if you want to set `tidb_enforce_mpp` to `true`, you must set `tidb_allow_mpp` to `true` first.
TiDBEnforceMPPExecution = "tidb_enforce_mpp"
// TiDBMaxTiFlashThreads is the maximum number of threads to execute the request which is pushed down to tiflash.
// Default value is -1, means it will not be pushed down to tiflash.
// If the value is bigger than -1, it will be pushed down to tiflash and used to create db context in tiflash.
TiDBMaxTiFlashThreads = "tidb_max_tiflash_threads"
// TiDBMPPStoreFailTTL is the unavailable time when a store is detected failed. During that time, tidb will not send any task to
// TiFlash even though the failed TiFlash node has been recovered.
TiDBMPPStoreFailTTL = "tidb_mpp_store_fail_ttl"
// TiDBInitChunkSize is used to control the init chunk size during query execution.
TiDBInitChunkSize = "tidb_init_chunk_size"
// TiDBMinPagingSize is used to control the min paging size in the coprocessor paging protocol.
TiDBMinPagingSize = "tidb_min_paging_size"
// TiDBMaxPagingSize is used to control the max paging size in the coprocessor paging protocol.
TiDBMaxPagingSize = "tidb_max_paging_size"
// TiDBEnableCascadesPlanner is used to control whether to enable the cascades planner.
TiDBEnableCascadesPlanner = "tidb_enable_cascades_planner"
// TiDBSkipUTF8Check skips the UTF8 validate process, validate UTF8 has performance cost, if we can make sure
// the input string values are valid, we can skip the check.
TiDBSkipUTF8Check = "tidb_skip_utf8_check"
// TiDBSkipASCIICheck skips the ASCII validate process
// old tidb may already have fields with invalid ASCII bytes
// disable ASCII validate can guarantee a safe replication
TiDBSkipASCIICheck = "tidb_skip_ascii_check"
// TiDBHashJoinConcurrency is used for hash join executor.
// The hash join outer executor starts multiple concurrent join workers to probe the hash table.
// tidb_hash_join_concurrency is deprecated, use tidb_executor_concurrency instead.
TiDBHashJoinConcurrency = "tidb_hash_join_concurrency"
// TiDBProjectionConcurrency is used for projection operator.
// This variable controls the worker number of projection operator.
// tidb_projection_concurrency is deprecated, use tidb_executor_concurrency instead.
TiDBProjectionConcurrency = "tidb_projection_concurrency"
// TiDBHashAggPartialConcurrency is used for hash agg executor.
// The hash agg executor starts multiple concurrent partial workers to do partial aggregate works.
// tidb_hashagg_partial_concurrency is deprecated, use tidb_executor_concurrency instead.
TiDBHashAggPartialConcurrency = "tidb_hashagg_partial_concurrency"
// TiDBHashAggFinalConcurrency is used for hash agg executor.
// The hash agg executor starts multiple concurrent final workers to do final aggregate works.
// tidb_hashagg_final_concurrency is deprecated, use tidb_executor_concurrency instead.
TiDBHashAggFinalConcurrency = "tidb_hashagg_final_concurrency"
// TiDBWindowConcurrency is used for window parallel executor.
// tidb_window_concurrency is deprecated, use tidb_executor_concurrency instead.
TiDBWindowConcurrency = "tidb_window_concurrency"
// TiDBMergeJoinConcurrency is used for merge join parallel executor
TiDBMergeJoinConcurrency = "tidb_merge_join_concurrency"
// TiDBStreamAggConcurrency is used for stream aggregation parallel executor.
// tidb_stream_agg_concurrency is deprecated, use tidb_executor_concurrency instead.
TiDBStreamAggConcurrency = "tidb_streamagg_concurrency"
// TiDBEnableParallelApply is used for parallel apply.
TiDBEnableParallelApply = "tidb_enable_parallel_apply"
// TiDBBackoffLockFast is used for tikv backoff base time in milliseconds.
TiDBBackoffLockFast = "tidb_backoff_lock_fast"
// TiDBBackOffWeight is used to control the max back off time in TiDB.
// The default maximum back off time is a small value.
// BackOffWeight could multiply it to let the user adjust the maximum time for retrying.
// Only positive integers can be accepted, which means that the maximum back off time can only grow.
TiDBBackOffWeight = "tidb_backoff_weight"
// TiDBDDLReorgWorkerCount defines the count of ddl reorg workers.
TiDBDDLReorgWorkerCount = "tidb_ddl_reorg_worker_cnt"
// TiDBDDLReorgBatchSize defines the transaction batch size of ddl reorg workers.
TiDBDDLReorgBatchSize = "tidb_ddl_reorg_batch_size"
// TiDBDDLErrorCountLimit defines the count of ddl error limit.
TiDBDDLErrorCountLimit = "tidb_ddl_error_count_limit"
// TiDBDDLReorgPriority defines the operations' priority of adding indices.
// It can be: PRIORITY_LOW, PRIORITY_NORMAL, PRIORITY_HIGH
TiDBDDLReorgPriority = "tidb_ddl_reorg_priority"
// TiDBEnableAutoIncrementInGenerated disables the mysql compatibility check on using auto-incremented columns in
// expression indexes and generated columns described here https://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.html for details.
TiDBEnableAutoIncrementInGenerated = "tidb_enable_auto_increment_in_generated"
// TiDBPlacementMode is used to control the mode for placement
TiDBPlacementMode = "tidb_placement_mode"
// TiDBMaxDeltaSchemaCount defines the max length of deltaSchemaInfos.
// deltaSchemaInfos is a queue that maintains the history of schema changes.
TiDBMaxDeltaSchemaCount = "tidb_max_delta_schema_count"
// TiDBScatterRegion will scatter the regions for DDLs when it is ON.
TiDBScatterRegion = "tidb_scatter_region"
// TiDBWaitSplitRegionFinish defines the split region behaviour is sync or async.
TiDBWaitSplitRegionFinish = "tidb_wait_split_region_finish"
// TiDBWaitSplitRegionTimeout uses to set the split and scatter region back off time.
TiDBWaitSplitRegionTimeout = "tidb_wait_split_region_timeout"
// TiDBForcePriority defines the operations' priority of all statements.
// It can be "NO_PRIORITY", "LOW_PRIORITY", "HIGH_PRIORITY", "DELAYED"
TiDBForcePriority = "tidb_force_priority"
// TiDBConstraintCheckInPlace indicates to check the constraint when the SQL executing.
// It could hurt the performance of bulking insert when it is ON.
TiDBConstraintCheckInPlace = "tidb_constraint_check_in_place"
// TiDBEnableWindowFunction is used to control whether to enable the window function.
TiDBEnableWindowFunction = "tidb_enable_window_function"
// TiDBEnablePipelinedWindowFunction is used to control whether to use pipelined window function, it only works when tidb_enable_window_function = true.
TiDBEnablePipelinedWindowFunction = "tidb_enable_pipelined_window_function"
// TiDBEnableStrictDoubleTypeCheck is used to control table field double type syntax check.
TiDBEnableStrictDoubleTypeCheck = "tidb_enable_strict_double_type_check"
// TiDBOptProjectionPushDown is used to control whether to pushdown projection to coprocessor.
TiDBOptProjectionPushDown = "tidb_opt_projection_push_down"
// TiDBEnableVectorizedExpression is used to control whether to enable the vectorized expression evaluation.
TiDBEnableVectorizedExpression = "tidb_enable_vectorized_expression"
// TiDBOptJoinReorderThreshold defines the threshold less than which
// we'll choose a rather time-consuming algorithm to calculate the join order.
TiDBOptJoinReorderThreshold = "tidb_opt_join_reorder_threshold"
// TiDBSlowQueryFile indicates which slow query log file for SLOW_QUERY table to parse.
TiDBSlowQueryFile = "tidb_slow_query_file"
// TiDBEnableFastAnalyze indicates to use fast analyze.
TiDBEnableFastAnalyze = "tidb_enable_fast_analyze"
// TiDBExpensiveQueryTimeThreshold indicates the time threshold of expensive query.
TiDBExpensiveQueryTimeThreshold = "tidb_expensive_query_time_threshold"
// TiDBEnableIndexMerge indicates to generate IndexMergePath.
TiDBEnableIndexMerge = "tidb_enable_index_merge"
// TiDBEnableNoopFuncs set true will enable using fake funcs(like get_lock release_lock)
TiDBEnableNoopFuncs = "tidb_enable_noop_functions"
// TiDBEnableStmtSummary indicates whether the statement summary is enabled.
TiDBEnableStmtSummary = "tidb_enable_stmt_summary"
// TiDBStmtSummaryInternalQuery indicates whether the statement summary contain internal query.
TiDBStmtSummaryInternalQuery = "tidb_stmt_summary_internal_query"
// TiDBStmtSummaryRefreshInterval indicates the refresh interval in seconds for each statement summary.
TiDBStmtSummaryRefreshInterval = "tidb_stmt_summary_refresh_interval"
// TiDBStmtSummaryHistorySize indicates the history size of each statement summary.
TiDBStmtSummaryHistorySize = "tidb_stmt_summary_history_size"
// TiDBStmtSummaryMaxStmtCount indicates the max number of statements kept in memory.
TiDBStmtSummaryMaxStmtCount = "tidb_stmt_summary_max_stmt_count"
// TiDBStmtSummaryMaxSQLLength indicates the max length of displayed normalized sql and sample sql.
TiDBStmtSummaryMaxSQLLength = "tidb_stmt_summary_max_sql_length"
// TiDBCapturePlanBaseline indicates whether the capture of plan baselines is enabled.
TiDBCapturePlanBaseline = "tidb_capture_plan_baselines"
// TiDBUsePlanBaselines indicates whether the use of plan baselines is enabled.
TiDBUsePlanBaselines = "tidb_use_plan_baselines"
// TiDBEvolvePlanBaselines indicates whether the evolution of plan baselines is enabled.
TiDBEvolvePlanBaselines = "tidb_evolve_plan_baselines"
// TiDBEnableExtendedStats indicates whether the extended statistics feature is enabled.
TiDBEnableExtendedStats = "tidb_enable_extended_stats"
// TiDBIsolationReadEngines indicates the tidb only read from the stores whose engine type is involved in IsolationReadEngines.
// Now, only support TiKV and TiFlash.
TiDBIsolationReadEngines = "tidb_isolation_read_engines"
// TiDBStoreLimit indicates the limit of sending request to a store, 0 means without limit.
TiDBStoreLimit = "tidb_store_limit"
// TiDBMetricSchemaStep indicates the step when query metric schema.
TiDBMetricSchemaStep = "tidb_metric_query_step"
// TiDBMetricSchemaRangeDuration indicates the range duration when query metric schema.
TiDBMetricSchemaRangeDuration = "tidb_metric_query_range_duration"
// TiDBEnableCollectExecutionInfo indicates that whether execution info is collected.
TiDBEnableCollectExecutionInfo = "tidb_enable_collect_execution_info"
// TiDBExecutorConcurrency is used for controlling the concurrency of all types of executors.
TiDBExecutorConcurrency = "tidb_executor_concurrency"
// TiDBEnableClusteredIndex indicates if clustered index feature is enabled.
TiDBEnableClusteredIndex = "tidb_enable_clustered_index"
// TiDBPartitionPruneMode indicates the partition prune mode used.
TiDBPartitionPruneMode = "tidb_partition_prune_mode"
// TiDBRedactLog indicates that whether redact log.
TiDBRedactLog = "tidb_redact_log"
// TiDBRestrictedReadOnly is meant for the cloud admin to toggle the cluster read only
TiDBRestrictedReadOnly = "tidb_restricted_read_only"
// TiDBSuperReadOnly is tidb's variant of mysql's super_read_only, which has some differences from mysql's super_read_only.
TiDBSuperReadOnly = "tidb_super_read_only"
// TiDBShardAllocateStep indicates the max size of continuous rowid shard in one transaction.
TiDBShardAllocateStep = "tidb_shard_allocate_step"
// TiDBEnableTelemetry indicates that whether usage data report to PingCAP is enabled.
TiDBEnableTelemetry = "tidb_enable_telemetry"
// TiDBEnableAmendPessimisticTxn indicates if amend pessimistic transactions is enabled.
TiDBEnableAmendPessimisticTxn = "tidb_enable_amend_pessimistic_txn"
// TiDBMemoryUsageAlarmRatio indicates the alarm threshold when memory usage of the tidb-server exceeds.
TiDBMemoryUsageAlarmRatio = "tidb_memory_usage_alarm_ratio"
// TiDBEnableRateLimitAction indicates whether enabled ratelimit action
TiDBEnableRateLimitAction = "tidb_enable_rate_limit_action"
// TiDBEnableAsyncCommit indicates whether to enable the async commit feature.
TiDBEnableAsyncCommit = "tidb_enable_async_commit"
// TiDBEnable1PC indicates whether to enable the one-phase commit feature.
TiDBEnable1PC = "tidb_enable_1pc"
// TiDBGuaranteeLinearizability indicates whether to guarantee linearizability.
TiDBGuaranteeLinearizability = "tidb_guarantee_linearizability"
// TiDBAnalyzeVersion indicates how tidb collects the analyzed statistics and how use to it.
TiDBAnalyzeVersion = "tidb_analyze_version"
// TiDBEnableIndexMergeJoin indicates whether to enable index merge join.
TiDBEnableIndexMergeJoin = "tidb_enable_index_merge_join"
// TiDBTrackAggregateMemoryUsage indicates whether track the memory usage of aggregate function.
TiDBTrackAggregateMemoryUsage = "tidb_track_aggregate_memory_usage"
// TiDBEnableExchangePartition indicates whether to enable exchange partition.
TiDBEnableExchangePartition = "tidb_enable_exchange_partition"
// TiDBAllowFallbackToTiKV indicates the engine types whose unavailability triggers fallback to TiKV.
// Now we only support TiFlash.
TiDBAllowFallbackToTiKV = "tidb_allow_fallback_to_tikv"
// TiDBEnableTopSQL indicates whether the top SQL is enabled.
TiDBEnableTopSQL = "tidb_enable_top_sql"
// TiDBTopSQLMaxTimeSeriesCount indicates the max number of statements been collected in each time series.
TiDBTopSQLMaxTimeSeriesCount = "tidb_top_sql_max_time_series_count"
// TiDBTopSQLMaxMetaCount indicates the max capacity of the collect meta per second.
TiDBTopSQLMaxMetaCount = "tidb_top_sql_max_meta_count"
// TiDBEnableLocalTxn indicates whether to enable Local Txn.
TiDBEnableLocalTxn = "tidb_enable_local_txn"
// TiDBTSOClientBatchMaxWaitTime indicates the max value of the TSO Batch Wait interval time of PD client.
TiDBTSOClientBatchMaxWaitTime = "tidb_tso_client_batch_max_wait_time"
// TiDBTxnCommitBatchSize is used to control the batch size of transaction commit related requests sent by TiDB to TiKV.
// If a single transaction has a large amount of writes, you can increase the batch size to improve the batch effect,
// setting too large will exceed TiKV's raft-entry-max-size limit and cause commit failure.
TiDBTxnCommitBatchSize = "tidb_txn_commit_batch_size"
// TiDBEnableTSOFollowerProxy indicates whether to enable the TSO Follower Proxy feature of PD client.
TiDBEnableTSOFollowerProxy = "tidb_enable_tso_follower_proxy"
// TiDBEnableOrderedResultMode indicates if stabilize query results.
TiDBEnableOrderedResultMode = "tidb_enable_ordered_result_mode"
// TiDBRemoveOrderbyInSubquery indicates whether to remove ORDER BY in subquery.
TiDBRemoveOrderbyInSubquery = "tidb_remove_orderby_in_subquery"
// TiDBEnablePseudoForOutdatedStats indicates whether use pseudo for outdated stats
TiDBEnablePseudoForOutdatedStats = "tidb_enable_pseudo_for_outdated_stats"
// TiDBRegardNULLAsPoint indicates whether regard NULL as point when optimizing
TiDBRegardNULLAsPoint = "tidb_regard_null_as_point"
// TiDBTmpTableMaxSize indicates the max memory size of temporary tables.
TiDBTmpTableMaxSize = "tidb_tmp_table_max_size"
// TiDBEnableLegacyInstanceScope indicates if instance scope can be set with SET SESSION.
TiDBEnableLegacyInstanceScope = "tidb_enable_legacy_instance_scope"
// TiDBTableCacheLease indicates the read lock lease of a cached table.
TiDBTableCacheLease = "tidb_table_cache_lease"
// TiDBStatsLoadSyncWait indicates the time sql execution will sync-wait for stats load.
TiDBStatsLoadSyncWait = "tidb_stats_load_sync_wait"
// TiDBEnableMutationChecker indicates whether to check data consistency for mutations
TiDBEnableMutationChecker = "tidb_enable_mutation_checker"
// TiDBTxnAssertionLevel indicates how strict the assertion will be, which helps to detect and preventing data &
// index inconsistency problems.
TiDBTxnAssertionLevel = "tidb_txn_assertion_level"
// TiDBIgnorePreparedCacheCloseStmt indicates whether to ignore close-stmt commands for prepared statements.
TiDBIgnorePreparedCacheCloseStmt = "tidb_ignore_prepared_cache_close_stmt"
// TiDBEnableNewCostInterface is a internal switch to indicates whether to use the new cost calculation interface.
TiDBEnableNewCostInterface = "tidb_enable_new_cost_interface"
// TiDBCostModelVersion is a internal switch to indicates the cost model version.
TiDBCostModelVersion = "tidb_cost_model_version"
// TiDBBatchPendingTiFlashCount indicates the maximum count of non-available TiFlash tables.
TiDBBatchPendingTiFlashCount = "tidb_batch_pending_tiflash_count"
// TiDBQueryLogMaxLen is used to set the max length of the query in the log.
TiDBQueryLogMaxLen = "tidb_query_log_max_len"
// TiDBEnableNoopVariables is used to indicate if noops appear in SHOW [GLOBAL] VARIABLES
TiDBEnableNoopVariables = "tidb_enable_noop_variables"
// TiDBNonTransactionalIgnoreError is used to ignore error in non-transactional DMLs.
// When set to false, a non-transactional DML returns when it meets the first error.
// When set to true, a non-transactional DML finishes all batches even if errors are met in some batches.
TiDBNonTransactionalIgnoreError = "tidb_nontransactional_ignore_error"
// Fine grained shuffle is disabled when TiFlashFineGrainedShuffleStreamCount is zero.
TiFlashFineGrainedShuffleStreamCount = "tiflash_fine_grained_shuffle_stream_count"
TiFlashFineGrainedShuffleBatchSize = "tiflash_fine_grained_shuffle_batch_size"
// TiDBSimplifiedMetrics controls whether to unregister some unused metrics.
TiDBSimplifiedMetrics = "tidb_simplified_metrics"
// TiDBMemoryDebugModeMinHeapInUse is used to set tidb memory debug mode trigger threshold.
// When set to 0, the function is disabled.
// When set to a negative integer, use memory debug mode to detect the issue of frequent allocation and release of memory.
// We do not actively trigger gc, and check whether the `tracker memory * (1+bias ratio) > heap in use` each 5s.
// When set to a positive integer, use memory debug mode to detect the issue of memory tracking inaccurate.
// We trigger runtime.GC() each 5s, and check whether the `tracker memory * (1+bias ratio) > heap in use`.
TiDBMemoryDebugModeMinHeapInUse = "tidb_memory_debug_mode_min_heap_inuse"
// TiDBMemoryDebugModeAlarmRatio is used set tidb memory debug mode bias ratio. Treat memory bias less than this ratio as noise.
TiDBMemoryDebugModeAlarmRatio = "tidb_memory_debug_mode_alarm_ratio"
// TiDBEnableAnalyzeSnapshot indicates whether to read data on snapshot when collecting statistics.
// When set to false, ANALYZE reads the latest data.
// When set to true, ANALYZE reads data on the snapshot at the beginning of ANALYZE.
TiDBEnableAnalyzeSnapshot = "tidb_enable_analyze_snapshot"
// TiDBDefaultStrMatchSelectivity controls some special cardinality estimation strategy for string match functions (like and regexp).
// When set to 0, Selectivity() will try to evaluate those functions with TopN and NULL in the stats to estimate,
// and the default selectivity and the selectivity for the histogram part will be 0.1.
// When set to (0, 1], Selectivity() will use the value of this variable as the default selectivity of those
// functions instead of the selectionFactor (0.8).
TiDBDefaultStrMatchSelectivity = "tidb_default_string_match_selectivity"
// TiDBEnablePrepPlanCache indicates whether to enable prepared plan cache
TiDBEnablePrepPlanCache = "tidb_enable_prepared_plan_cache"
// TiDBPrepPlanCacheSize indicates the number of cached statements.
TiDBPrepPlanCacheSize = "tidb_prepared_plan_cache_size"
// TiDBEnableGeneralPlanCache indicates whether to enable general plan cache.
TiDBEnableGeneralPlanCache = "tidb_enable_general_plan_cache"
// TiDBGeneralPlanCacheSize controls the size of general plan cache.
TiDBGeneralPlanCacheSize = "tidb_general_plan_cache_size"
// TiDBConstraintCheckInPlacePessimistic controls whether to skip certain kinds of pessimistic locks.
TiDBConstraintCheckInPlacePessimistic = "tidb_constraint_check_in_place_pessimistic"
// TiDBEnableForeignKey indicates whether to enable foreign key feature.
// TODO(crazycs520): remove this after foreign key GA.
TiDBEnableForeignKey = "tidb_enable_foreign_key"
)
// TiDB vars that have only global scope
const (
// TiDBGCEnable turns garbage collection on or OFF
TiDBGCEnable = "tidb_gc_enable"
// TiDBGCRunInterval sets the interval that GC runs
TiDBGCRunInterval = "tidb_gc_run_interval"
// TiDBGCLifetime sets the retention window of older versions
TiDBGCLifetime = "tidb_gc_life_time"
// TiDBGCConcurrency sets the concurrency of garbage collection. -1 = AUTO value
TiDBGCConcurrency = "tidb_gc_concurrency"
// TiDBGCScanLockMode enables the green GC feature (default)
TiDBGCScanLockMode = "tidb_gc_scan_lock_mode"
// TiDBGCMaxWaitTime sets max time for gc advances the safepoint delayed by active transactions
TiDBGCMaxWaitTime = "tidb_gc_max_wait_time"
// TiDBEnableEnhancedSecurity restricts SUPER users from certain operations.
TiDBEnableEnhancedSecurity = "tidb_enable_enhanced_security"
// TiDBEnableHistoricalStats enables the historical statistics feature (default off)
TiDBEnableHistoricalStats = "tidb_enable_historical_stats"
// TiDBPersistAnalyzeOptions persists analyze options for later analyze and auto-analyze
TiDBPersistAnalyzeOptions = "tidb_persist_analyze_options"
// TiDBEnableColumnTracking enables collecting predicate columns.
TiDBEnableColumnTracking = "tidb_enable_column_tracking"
// TiDBDisableColumnTrackingTime records the last time TiDBEnableColumnTracking is set off.
// It is used to invalidate the collected predicate columns after turning off TiDBEnableColumnTracking, which avoids physical deletion.
// It doesn't have cache in memory, and we directly get/set the variable value from/to mysql.tidb.
TiDBDisableColumnTrackingTime = "tidb_disable_column_tracking_time"
// TiDBStatsLoadPseudoTimeout indicates whether to fallback to pseudo stats after load timeout.
TiDBStatsLoadPseudoTimeout = "tidb_stats_load_pseudo_timeout"
// TiDBMemQuotaBindingCache indicates the memory quota for the bind cache.
TiDBMemQuotaBindingCache = "tidb_mem_quota_binding_cache"
// TiDBRCReadCheckTS indicates the tso optimization for read-consistency read is enabled.
TiDBRCReadCheckTS = "tidb_rc_read_check_ts"
// TiDBCommitterConcurrency controls the number of running concurrent requests in the commit phase.
TiDBCommitterConcurrency = "tidb_committer_concurrency"
// TiDBEnableBatchDML enables batch dml.
TiDBEnableBatchDML = "tidb_enable_batch_dml"
// TiDBStatsCacheMemQuota records stats cache quota
TiDBStatsCacheMemQuota = "tidb_stats_cache_mem_quota"
// TiDBMemQuotaAnalyze indicates the memory quota for all analyze jobs.
TiDBMemQuotaAnalyze = "tidb_mem_quota_analyze"
// TiDBEnableAutoAnalyze determines whether TiDB executes automatic analysis.
TiDBEnableAutoAnalyze = "tidb_enable_auto_analyze"
// TiDBMemOOMAction indicates what operation TiDB perform when a single SQL statement exceeds
// the memory quota specified by tidb_mem_quota_query and cannot be spilled to disk.
TiDBMemOOMAction = "tidb_mem_oom_action"
// TiDBPrepPlanCacheMemoryGuardRatio is used to prevent [performance.max-memory] from being exceeded
TiDBPrepPlanCacheMemoryGuardRatio = "tidb_prepared_plan_cache_memory_guard_ratio"
// TiDBMaxAutoAnalyzeTime is the max time that auto analyze can run. If auto analyze runs longer than the value, it
// will be killed. 0 indicates that there is no time limit.
TiDBMaxAutoAnalyzeTime = "tidb_max_auto_analyze_time"
// TiDBEnableConcurrentDDL indicates whether to enable the new DDL framework.
TiDBEnableConcurrentDDL = "tidb_enable_concurrent_ddl"
// TiDBAuthSigningCert indicates the path of the signing certificate to do token-based authentication.
TiDBAuthSigningCert = "tidb_auth_signing_cert"
// TiDBAuthSigningKey indicates the path of the signing key to do token-based authentication.
TiDBAuthSigningKey = "tidb_auth_signing_key"
// TiDBGenerateBinaryPlan indicates whether binary plan should be generated in slow log and statements summary.
TiDBGenerateBinaryPlan = "tidb_generate_binary_plan"
// TiDBEnableGCAwareMemoryTrack indicates whether to turn-on GC-aware memory track.
TiDBEnableGCAwareMemoryTrack = "tidb_enable_gc_aware_memory_track"
// TiDBEnableTmpStorageOnOOM controls whether to enable the temporary storage for some operators
// when a single SQL statement exceeds the memory quota specified by the memory quota.
TiDBEnableTmpStorageOnOOM = "tidb_enable_tmp_storage_on_oom"
// TiDBDDLEnableFastReorg indicates whether to use lighting backfill process for adding index.
TiDBDDLEnableFastReorg = "tidb_ddl_enable_fast_reorg"
// TiDBDDLDiskQuota used to set disk quota for lightning add index.
TiDBDDLDiskQuota = "tidb_ddl_disk_quota"
// TiDBOptRangeMaxSize is the max memory limit for ranges. When the optimizer estimates that the memory usage of complete
// ranges would exceed the limit, it chooses less accurate ranges such as full range. 0 indicates that there is no memory
// limit for ranges.
TiDBOptRangeMaxSize = "tidb_opt_range_max_size"
)
// TiDB intentional limits
// Can be raised in the future.
const (
// MaxConfigurableConcurrency is the maximum number of "threads" (goroutines) that can be specified
// for any type of configuration item that has concurrent workers.
MaxConfigurableConcurrency = 256
)
// Default TiDB system variable values.
const (
DefHostname = "localhost"
DefIndexLookupConcurrency = ConcurrencyUnset
DefIndexLookupJoinConcurrency = ConcurrencyUnset
DefIndexSerialScanConcurrency = 1
DefIndexJoinBatchSize = 25000
DefIndexLookupSize = 20000
DefDistSQLScanConcurrency = 15
DefBuildStatsConcurrency = 4
DefAutoAnalyzeRatio = 0.5
DefAutoAnalyzeStartTime = "00:00 +0000"
DefAutoAnalyzeEndTime = "23:59 +0000"
DefAutoIncrementIncrement = 1
DefAutoIncrementOffset = 1
DefChecksumTableConcurrency = 4
DefSkipUTF8Check = false
DefSkipASCIICheck = false
DefOptAggPushDown = false
DefOptCartesianBCJ = 1
DefOptMPPOuterJoinFixedBuildSide = false
DefOptWriteRowID = false
DefOptEnableCorrelationAdjustment = true
DefOptLimitPushDownThreshold = 100
DefOptCorrelationThreshold = 0.9
DefOptCorrelationExpFactor = 1
DefOptCPUFactor = 3.0
DefOptCopCPUFactor = 3.0
DefOptTiFlashConcurrencyFactor = 24.0
DefOptNetworkFactor = 1.0
DefOptScanFactor = 1.5
DefOptDescScanFactor = 3.0
DefOptSeekFactor = 20.0
DefOptMemoryFactor = 0.001
DefOptDiskFactor = 1.5
DefOptConcurrencyFactor = 3.0
DefOptCPUFactorV2 = 30.0
DefOptCopCPUFactorV2 = 30.0
DefOptTiFlashCPUFactorV2 = 2.0
DefOptNetworkFactorV2 = 4.0
DefOptScanFactorV2 = 100.0
DefOptDescScanFactorV2 = 150.0
DefOptTiFlashScanFactorV2 = 15.0
DefOptSeekFactorV2 = 9500000.0
DefOptMemoryFactorV2 = 0.001
DefOptDiskFactorV2 = 1.5
DefOptConcurrencyFactorV2 = 3.0
DefOptForceInlineCTE = false
DefOptInSubqToJoinAndAgg = true
DefOptPreferRangeScan = false
DefBatchInsert = false
DefBatchDelete = false
DefBatchCommit = false
DefCurretTS = 0
DefInitChunkSize = 32
DefMinPagingSize = int(paging.MinPagingSize)
DefMaxPagingSize = int(paging.MaxPagingSize)
DefMaxChunkSize = 1024
DefDMLBatchSize = 0
DefMaxPreparedStmtCount = -1
DefWaitTimeout = 28800
DefTiDBMemQuotaApplyCache = 32 << 20 // 32MB.
DefTiDBMemQuotaBindingCache = 64 << 20 // 64MB.
DefTiDBGeneralLog = false
DefTiDBPProfSQLCPU = 0
DefTiDBRetryLimit = 10
DefTiDBDisableTxnAutoRetry = true
DefTiDBConstraintCheckInPlace = false
DefTiDBHashJoinConcurrency = ConcurrencyUnset
DefTiDBProjectionConcurrency = ConcurrencyUnset
DefBroadcastJoinThresholdSize = 100 * 1024 * 1024
DefBroadcastJoinThresholdCount = 10 * 1024
DefTiDBOptimizerSelectivityLevel = 0
DefTiDBOptimizerEnableNewOFGB = false
DefTiDBEnableOuterJoinReorder = false
DefTiDBAllowBatchCop = 1
DefTiDBAllowMPPExecution = true
DefTiDBHashExchangeWithNewCollation = true
DefTiDBEnforceMPPExecution = false
DefTiFlashMaxThreads = -1
DefTiDBMPPStoreFailTTL = "60s"
DefTiDBTxnMode = ""
DefTiDBRowFormatV1 = 1
DefTiDBRowFormatV2 = 2
DefTiDBDDLReorgWorkerCount = 4
DefTiDBDDLReorgBatchSize = 256
DefTiDBDDLErrorCountLimit = 512
DefTiDBMaxDeltaSchemaCount = 1024
DefTiDBPlacementMode = PlacementModeStrict
DefTiDBEnableAutoIncrementInGenerated = false
DefTiDBHashAggPartialConcurrency = ConcurrencyUnset
DefTiDBHashAggFinalConcurrency = ConcurrencyUnset
DefTiDBWindowConcurrency = ConcurrencyUnset
DefTiDBMergeJoinConcurrency = 1 // disable optimization by default
DefTiDBStreamAggConcurrency = 1
DefTiDBForcePriority = mysql.NoPriority
DefEnableWindowFunction = true
DefEnablePipelinedWindowFunction = true
DefEnableStrictDoubleTypeCheck = true
DefEnableVectorizedExpression = true
DefTiDBOptJoinReorderThreshold = 0
DefTiDBDDLSlowOprThreshold = 300
DefTiDBUseFastAnalyze = false
DefTiDBSkipIsolationLevelCheck = false
DefTiDBExpensiveQueryTimeThreshold = 60 // 60s
DefTiDBScatterRegion = false
DefTiDBWaitSplitRegionFinish = true
DefWaitSplitRegionTimeout = 300 // 300s
DefTiDBEnableNoopFuncs = Off
DefTiDBEnableNoopVariables = true
DefTiDBAllowRemoveAutoInc = false
DefTiDBUsePlanBaselines = true
DefTiDBEvolvePlanBaselines = false
DefTiDBEvolvePlanTaskMaxTime = 600 // 600s
DefTiDBEvolvePlanTaskStartTime = "00:00 +0000"
DefTiDBEvolvePlanTaskEndTime = "23:59 +0000"
DefInnodbLockWaitTimeout = 50 // 50s
DefTiDBStoreLimit = 0
DefTiDBMetricSchemaStep = 60 // 60s
DefTiDBMetricSchemaRangeDuration = 60 // 60s
DefTiDBFoundInPlanCache = false
DefTiDBFoundInBinding = false
DefTiDBEnableCollectExecutionInfo = true
DefTiDBAllowAutoRandExplicitInsert = false
DefTiDBEnableClusteredIndex = ClusteredIndexDefModeOn
DefTiDBRedactLog = false
DefTiDBRestrictedReadOnly = false
DefTiDBSuperReadOnly = false
DefTiDBShardAllocateStep = math.MaxInt64
DefTiDBEnableTelemetry = true
DefTiDBEnableParallelApply = false
DefTiDBEnableAmendPessimisticTxn = false
DefTiDBPartitionPruneMode = "static"
DefTiDBEnableRateLimitAction = true
DefTiDBEnableAsyncCommit = false
DefTiDBEnable1PC = false
DefTiDBGuaranteeLinearizability = true
DefTiDBAnalyzeVersion = 2
DefTiDBEnableIndexMergeJoin = false
DefTiDBTrackAggregateMemoryUsage = true
DefTiDBEnableExchangePartition = false
DefCTEMaxRecursionDepth = 1000
DefTiDBTmpTableMaxSize = 64 << 20 // 64MB.
DefTiDBEnableLocalTxn = false
DefTiDBTSOClientBatchMaxWaitTime = 0.0 // 0ms
DefTiDBEnableTSOFollowerProxy = false
DefTiDBEnableOrderedResultMode = false
DefTiDBEnablePseudoForOutdatedStats = false
DefTiDBRegardNULLAsPoint = true
DefEnablePlacementCheck = true
DefTimestamp = "0"
DefTimestampFloat = 0.0
DefTiDBEnableStmtSummary = true
DefTiDBStmtSummaryInternalQuery = false
DefTiDBStmtSummaryRefreshInterval = 1800
DefTiDBStmtSummaryHistorySize = 24
DefTiDBStmtSummaryMaxStmtCount = 3000
DefTiDBStmtSummaryMaxSQLLength = 4096
DefTiDBCapturePlanBaseline = Off
DefTiDBEnableIndexMerge = true
DefEnableLegacyInstanceScope = true
DefTiDBTableCacheLease = 3 // 3s
DefTiDBPersistAnalyzeOptions = true
DefTiDBEnableColumnTracking = false
DefTiDBStatsLoadSyncWait = 0
DefTiDBStatsLoadPseudoTimeout = true
DefSysdateIsNow = false
DefTiDBEnableMutationChecker = false
DefTiDBTxnAssertionLevel = AssertionOffStr
DefTiDBIgnorePreparedCacheCloseStmt = false