Repository: pingcap/tidb
File: sessionctx/variable/tidb_vars.go (Go)

Code before:
	// 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"
	// 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"
	// 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"
	// TiDBGCAwareMemoryTrack indicates whether to turn-on GC-aware memory track.
	TiDBGCAwareMemoryTrack = "tidb_gc_aware_memory_track"
)

// 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

Review comment (suggestion):
```suggestion
	TiDBEnableGCAwareMemoryTrack = "tidb_enable_gc_aware_memory_track"
```

I tend to introduce `enable` if this variable is used to control the feature which is common in other variables.

Code after:
	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"
	// 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"
	// 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"
)

// 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.