From d289255daacf307768c83bd9080973d1115114f3 Mon Sep 17 00:00:00 2001 From: Frank945946 <108602632+Frank945946@users.noreply.github.com> Date: Fri, 3 Apr 2026 15:13:15 +0800 Subject: [PATCH 1/3] This is an automated cherry-pick of #22691 Signed-off-by: ti-chi-bot --- system-variables.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/system-variables.md b/system-variables.md index 3692fd799b35b..ef11834f1f0f1 100644 --- a/system-variables.md +++ b/system-variables.md @@ -5097,9 +5097,18 @@ SHOW WARNINGS; - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Type: Integer +<<<<<<< HEAD - Default value: `0` - Range: `[0, 9223372036854775807]` - This variable controls the size of the schema cache in TiDB. The unit is byte. The default value is `0`, which means that the cache limit feature is not enabled. When this feature is enabled, TiDB uses the value you set as the maximum available memory limit, and uses the Least Recently Used (LRU) algorithm to cache the required tables, effectively reducing the memory occupied by the schema information. +======= +- Default value: `536870912` (512 MiB) +- Range: `0` or `[67108864, 9223372036854775807]` +- Before TiDB v8.4.0, the default value of this variable is `0`. +- Starting from TiDB v8.4.0, the default value is `536870912`. When you upgrade from an earlier version to v8.4.0 or later, the old value set in the earlier version is used. +- This variable controls the size of the schema cache in TiDB. The unit is byte. Setting this variable to `0` means the cache limit feature is disabled. To enable this feature, you need to set a value within the range `[67108864, 9223372036854775807]`. TiDB will use this value as the maximum available memory limit and apply the Least Recently Used (LRU) algorithm to cache the required tables, effectively reducing the memory used by schema information. +- If your cluster contains a large number of partitioned tables, or if you frequently perform DDL operations on partitioned tables (such as `TRUNCATE` or `DROP PARTITION`), it is recommended that you set this variable to `0`. +>>>>>>> b40d781f5c (Update system-variable tidb_schema_cache_size (#22691)) ### tidb_schema_version_cache_limit New in v7.4.0 From 9c4d905853194fbc73793b791270322a35798c9a Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 3 Apr 2026 15:16:01 +0800 Subject: [PATCH 2/3] Update system-variables.md --- system-variables.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/system-variables.md b/system-variables.md index ef11834f1f0f1..10e725cbacbea 100644 --- a/system-variables.md +++ b/system-variables.md @@ -5097,16 +5097,9 @@ SHOW WARNINGS; - Persists to cluster: Yes - Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No - Type: Integer -<<<<<<< HEAD - Default value: `0` - Range: `[0, 9223372036854775807]` - This variable controls the size of the schema cache in TiDB. The unit is byte. The default value is `0`, which means that the cache limit feature is not enabled. When this feature is enabled, TiDB uses the value you set as the maximum available memory limit, and uses the Least Recently Used (LRU) algorithm to cache the required tables, effectively reducing the memory occupied by the schema information. -======= -- Default value: `536870912` (512 MiB) -- Range: `0` or `[67108864, 9223372036854775807]` -- Before TiDB v8.4.0, the default value of this variable is `0`. -- Starting from TiDB v8.4.0, the default value is `536870912`. When you upgrade from an earlier version to v8.4.0 or later, the old value set in the earlier version is used. -- This variable controls the size of the schema cache in TiDB. The unit is byte. Setting this variable to `0` means the cache limit feature is disabled. To enable this feature, you need to set a value within the range `[67108864, 9223372036854775807]`. TiDB will use this value as the maximum available memory limit and apply the Least Recently Used (LRU) algorithm to cache the required tables, effectively reducing the memory used by schema information. - If your cluster contains a large number of partitioned tables, or if you frequently perform DDL operations on partitioned tables (such as `TRUNCATE` or `DROP PARTITION`), it is recommended that you set this variable to `0`. >>>>>>> b40d781f5c (Update system-variable tidb_schema_cache_size (#22691)) From af39a85dd96e0e2b0003c308a5e12e5d5af74732 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Fri, 3 Apr 2026 15:20:50 +0800 Subject: [PATCH 3/3] Update system-variables.md --- system-variables.md | 1 - 1 file changed, 1 deletion(-) diff --git a/system-variables.md b/system-variables.md index 10e725cbacbea..82e97cc987f49 100644 --- a/system-variables.md +++ b/system-variables.md @@ -5101,7 +5101,6 @@ SHOW WARNINGS; - Range: `[0, 9223372036854775807]` - This variable controls the size of the schema cache in TiDB. The unit is byte. The default value is `0`, which means that the cache limit feature is not enabled. When this feature is enabled, TiDB uses the value you set as the maximum available memory limit, and uses the Least Recently Used (LRU) algorithm to cache the required tables, effectively reducing the memory occupied by the schema information. - If your cluster contains a large number of partitioned tables, or if you frequently perform DDL operations on partitioned tables (such as `TRUNCATE` or `DROP PARTITION`), it is recommended that you set this variable to `0`. ->>>>>>> b40d781f5c (Update system-variable tidb_schema_cache_size (#22691)) ### tidb_schema_version_cache_limit New in v7.4.0