From 588cac61f196f8df2235ab8a6b0ec921f96bf63c Mon Sep 17 00:00:00 2001
From: jiong-nba <2301210292@stu.pku.edu.cn>
Date: Tue, 10 Mar 2026 10:57:19 +0800
Subject: [PATCH 01/15] docs: sync session connect attrs docs with tidb#66617
---
.../information-schema-slow-query.md | 6 ++++--
.../performance-schema-session-connect-attrs.md | 12 ++++++++++++
status-variables.md | 12 ++++++++++++
system-variable-reference.md | 7 +++++++
system-variables.md | 17 +++++++++++++++++
5 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md
index 7413fa8b46356..b19224c833ed6 100644
--- a/information-schema/information-schema-slow-query.md
+++ b/information-schema/information-schema-slow-query.md
@@ -126,9 +126,10 @@ The output is as follows:
| Plan_digest | varchar(128) | YES | | NULL | |
| Binary_plan | longtext | YES | | NULL | |
| Prev_stmt | longtext | YES | | NULL | |
+| Session_connect_attrs | json | YES | | NULL | |
| Query | longtext | YES | | NULL | |
+--------------------------------------------+-----------------+------+------+---------+-------+
-89 rows in set (0.00 sec)
+90 rows in set (0.00 sec)
```
The maximum statement length of the `Query` column is limited by the [`tidb_stmt_summary_max_sql_length`](/system-variables.md#tidb_stmt_summary_max_sql_length-new-in-v40) system variable.
@@ -246,9 +247,10 @@ The output is as follows:
| Plan_digest | varchar(128) | YES | | NULL | |
| Binary_plan | longtext | YES | | NULL | |
| Prev_stmt | longtext | YES | | NULL | |
+| Session_connect_attrs | json | YES | | NULL | |
| Query | longtext | YES | | NULL | |
+--------------------------------------------+-----------------+------+------+---------+-------+
-90 rows in set (0.00 sec)
+91 rows in set (0.00 sec)
```
When the cluster system table is queried, TiDB does not obtain data from all nodes, but pushes down the related calculation to other nodes. The execution plan is as follows:
diff --git a/performance-schema/performance-schema-session-connect-attrs.md b/performance-schema/performance-schema-session-connect-attrs.md
index fabbce7e9f110..8248a0958b5fa 100644
--- a/performance-schema/performance-schema-session-connect-attrs.md
+++ b/performance-schema/performance-schema-session-connect-attrs.md
@@ -66,3 +66,15 @@ Fields in the `SESSION_CONNECT_ATTRS` table are described as follows:
* `ATTR_NAME`: Attribute name.
* `ATTR_VALUE`: Attribute value.
* `ORDINAL_POSITION`: Ordinal position of the name/value pair.
+
+## Size limit and truncation
+
+TiDB uses the [`performance_schema_session_connect_attrs_size`](/system-variables.md#performance_schema_session_connect_attrs_size) global system variable to control the maximum total size of connection attributes per session.
+
+- Default value: `4096` bytes
+- Range: `[-1, 65536]`
+- `-1` means no configured limit, and TiDB treats it as up to `65536` bytes.
+
+When the total size exceeds this limit, TiDB truncates excess attributes and adds `_truncated` to indicate the number of truncated bytes.
+
+TiDB also enforces a hard limit of 1 MiB on connection attribute payload in handshake packets. If this hard limit is exceeded, the connection is rejected.
diff --git a/status-variables.md b/status-variables.md
index ec577d88c6173..ec07a6e52e2bf 100644
--- a/status-variables.md
+++ b/status-variables.md
@@ -31,6 +31,18 @@ Additionally, the [FLUSH STATUS](/sql-statements/sql-statement-flush-status.md)
- Type: Integer
- The compression level that is used for the MySQL Protocol.
+### Performance_schema_session_connect_attrs_longest_seen
+
+- Scope: GLOBAL
+- Type: Integer
+- The largest total size (in bytes) of session connection attributes observed by TiDB.
+
+### Performance_schema_session_connect_attrs_lost
+
+- Scope: GLOBAL
+- Type: Integer
+- The number of sessions whose connection attributes were truncated due to `performance_schema_session_connect_attrs_size`.
+
### Ssl_cipher
- Scope: SESSION | GLOBAL
diff --git a/system-variable-reference.md b/system-variable-reference.md
index ef41aa77a6c3c..3315e086b218c 100644
--- a/system-variable-reference.md
+++ b/system-variable-reference.md
@@ -600,6 +600,13 @@ Referenced in:
- [TiDB 8.5.0 Release Notes](/releases/release-8.5.0.md)
- [TiDB 7.6.0 Release Notes](/releases/release-7.6.0.md)
+### performance_schema_session_connect_attrs_size
+
+Referenced in:
+
+- [SESSION_CONNECT_ATTRS](/performance-schema/performance-schema-session-connect-attrs.md)
+- [System Variables](/system-variables.md#performance_schema_session_connect_attrs_size)
+
### plugin_dir
Referenced in:
diff --git a/system-variables.md b/system-variables.md
index 79af0db79a694..9d56d900b1394 100644
--- a/system-variables.md
+++ b/system-variables.md
@@ -789,6 +789,23 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count';
1 row in set (0.00 sec)
```
+### performance_schema_session_connect_attrs_size
+
+- Scope: GLOBAL
+- Persists to cluster: Yes
+- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
+- Type: Integer
+- Default value: `4096`
+- Range: `[-1, 65536]`
+- Unit: Bytes
+- Controls the maximum total size of connection attributes for each session.
+- If the total size of connection attributes exceeds this value, TiDB truncates excess attributes and adds `_truncated` to indicate the number of truncated bytes.
+- The value `-1` means no configured limit and is treated as up to `65536` bytes in TiDB.
+
+> **Note:**
+>
+> TiDB enforces a hard limit of 1 MiB for handshake connection attributes. If this hard limit is exceeded, the connection is rejected.
+
### pd_enable_follower_handle_region New in v7.6.0
- Scope: GLOBAL
From 8f0c5181c328617cba937a4ad95293a9001f3fc4 Mon Sep 17 00:00:00 2001
From: jiong-nba <2301210292@stu.pku.edu.cn>
Date: Tue, 10 Mar 2026 17:01:04 +0800
Subject: [PATCH 02/15] docs: clarify connect attrs size impact on slow log
payload
---
information-schema/information-schema-slow-query.md | 2 ++
performance-schema/performance-schema-session-connect-attrs.md | 2 ++
system-variables.md | 2 ++
3 files changed, 6 insertions(+)
diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md
index b19224c833ed6..82b3635fb7e56 100644
--- a/information-schema/information-schema-slow-query.md
+++ b/information-schema/information-schema-slow-query.md
@@ -134,6 +134,8 @@ The output is as follows:
The maximum statement length of the `Query` column is limited by the [`tidb_stmt_summary_max_sql_length`](/system-variables.md#tidb_stmt_summary_max_sql_length-new-in-v40) system variable.
+The `Session_connect_attrs` column stores session connection attributes in JSON format parsed from the slow log. TiDB controls the maximum payload size written to this field using [`performance_schema_session_connect_attrs_size`](/system-variables.md#performance_schema_session_connect_attrs_size).
+
## CLUSTER_SLOW_QUERY table
The `CLUSTER_SLOW_QUERY` table provides the slow query information of all nodes in the cluster, which is the parsing result of the TiDB slow log files. You can use the `CLUSTER_SLOW_QUERY` table the way you do with `SLOW_QUERY`. The table schema of the `CLUSTER_SLOW_QUERY` table differs from that of the `SLOW_QUERY` table in that an `INSTANCE` column is added to `CLUSTER_SLOW_QUERY`. The `INSTANCE` column represents the TiDB node address of the row information on the slow query.
diff --git a/performance-schema/performance-schema-session-connect-attrs.md b/performance-schema/performance-schema-session-connect-attrs.md
index 8248a0958b5fa..f4dcd14012bee 100644
--- a/performance-schema/performance-schema-session-connect-attrs.md
+++ b/performance-schema/performance-schema-session-connect-attrs.md
@@ -77,4 +77,6 @@ TiDB uses the [`performance_schema_session_connect_attrs_size`](/system-variable
When the total size exceeds this limit, TiDB truncates excess attributes and adds `_truncated` to indicate the number of truncated bytes.
+The accepted connection attributes are also written to the `Session_connect_attrs` field in the slow log and can be queried from `INFORMATION_SCHEMA.SLOW_QUERY` and `INFORMATION_SCHEMA.CLUSTER_SLOW_QUERY`. To control the payload size written to the slow log, adjust `performance_schema_session_connect_attrs_size`.
+
TiDB also enforces a hard limit of 1 MiB on connection attribute payload in handshake packets. If this hard limit is exceeded, the connection is rejected.
diff --git a/system-variables.md b/system-variables.md
index 9d56d900b1394..cef35e91b31ee 100644
--- a/system-variables.md
+++ b/system-variables.md
@@ -800,6 +800,8 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count';
- Unit: Bytes
- Controls the maximum total size of connection attributes for each session.
- If the total size of connection attributes exceeds this value, TiDB truncates excess attributes and adds `_truncated` to indicate the number of truncated bytes.
+- Connection attributes accepted within this limit are written to the `Session_connect_attrs` field in the slow log and can be queried from [`INFORMATION_SCHEMA.SLOW_QUERY`](/information-schema/information-schema-slow-query.md) and `INFORMATION_SCHEMA.CLUSTER_SLOW_QUERY`.
+- You can control the size of `Session_connect_attrs` recorded in the slow log by adjusting this variable.
- The value `-1` means no configured limit and is treated as up to `65536` bytes in TiDB.
> **Note:**
From e005d6338e1a1b8c38b4dcd9fc5b919299d5d2a8 Mon Sep 17 00:00:00 2001
From: jiong-nba <2301210292@stu.pku.edu.cn>
Date: Mon, 16 Mar 2026 11:07:56 +0800
Subject: [PATCH 03/15] docs: mark connect attrs size variable as new in v9.0.0
---
information-schema/information-schema-slow-query.md | 2 +-
performance-schema/performance-schema-session-connect-attrs.md | 2 +-
system-variable-reference.md | 2 +-
system-variables.md | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/information-schema/information-schema-slow-query.md b/information-schema/information-schema-slow-query.md
index 82b3635fb7e56..9b3de52791dac 100644
--- a/information-schema/information-schema-slow-query.md
+++ b/information-schema/information-schema-slow-query.md
@@ -134,7 +134,7 @@ The output is as follows:
The maximum statement length of the `Query` column is limited by the [`tidb_stmt_summary_max_sql_length`](/system-variables.md#tidb_stmt_summary_max_sql_length-new-in-v40) system variable.
-The `Session_connect_attrs` column stores session connection attributes in JSON format parsed from the slow log. TiDB controls the maximum payload size written to this field using [`performance_schema_session_connect_attrs_size`](/system-variables.md#performance_schema_session_connect_attrs_size).
+The `Session_connect_attrs` column stores session connection attributes in JSON format parsed from the slow log. TiDB controls the maximum payload size written to this field using [`performance_schema_session_connect_attrs_size`](/system-variables.md#performance_schema_session_connect_attrs_size-new-in-v900).
## CLUSTER_SLOW_QUERY table
diff --git a/performance-schema/performance-schema-session-connect-attrs.md b/performance-schema/performance-schema-session-connect-attrs.md
index f4dcd14012bee..f6ee682eb4f4e 100644
--- a/performance-schema/performance-schema-session-connect-attrs.md
+++ b/performance-schema/performance-schema-session-connect-attrs.md
@@ -69,7 +69,7 @@ Fields in the `SESSION_CONNECT_ATTRS` table are described as follows:
## Size limit and truncation
-TiDB uses the [`performance_schema_session_connect_attrs_size`](/system-variables.md#performance_schema_session_connect_attrs_size) global system variable to control the maximum total size of connection attributes per session.
+TiDB uses the [`performance_schema_session_connect_attrs_size`](/system-variables.md#performance_schema_session_connect_attrs_size-new-in-v900) global system variable to control the maximum total size of connection attributes per session.
- Default value: `4096` bytes
- Range: `[-1, 65536]`
diff --git a/system-variable-reference.md b/system-variable-reference.md
index 3315e086b218c..d5f2db378b997 100644
--- a/system-variable-reference.md
+++ b/system-variable-reference.md
@@ -605,7 +605,7 @@ Referenced in:
Referenced in:
- [SESSION_CONNECT_ATTRS](/performance-schema/performance-schema-session-connect-attrs.md)
-- [System Variables](/system-variables.md#performance_schema_session_connect_attrs_size)
+- [System Variables](/system-variables.md#performance_schema_session_connect_attrs_size-new-in-v900)
### plugin_dir
diff --git a/system-variables.md b/system-variables.md
index cef35e91b31ee..e14b0a10012ba 100644
--- a/system-variables.md
+++ b/system-variables.md
@@ -789,7 +789,7 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count';
1 row in set (0.00 sec)
```
-### performance_schema_session_connect_attrs_size
+### performance_schema_session_connect_attrs_size New in v9.0.0
- Scope: GLOBAL
- Persists to cluster: Yes
From 7d51a3e5a12e5c88c642adee1e1c45d349140bbb Mon Sep 17 00:00:00 2001
From: jiong-nba <2301210292@stu.pku.edu.cn>
Date: Wed, 25 Mar 2026 15:11:51 +0800
Subject: [PATCH 04/15] docs: clarify zero value behavior for connect attrs
size
---
system-variables.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/system-variables.md b/system-variables.md
index e14b0a10012ba..305a0d5e340dd 100644
--- a/system-variables.md
+++ b/system-variables.md
@@ -800,6 +800,7 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count';
- Unit: Bytes
- Controls the maximum total size of connection attributes for each session.
- If the total size of connection attributes exceeds this value, TiDB truncates excess attributes and adds `_truncated` to indicate the number of truncated bytes.
+- If the value is set to `0`, TiDB does not retain client-provided session connection attributes, which effectively disables recording session attributes.
- Connection attributes accepted within this limit are written to the `Session_connect_attrs` field in the slow log and can be queried from [`INFORMATION_SCHEMA.SLOW_QUERY`](/information-schema/information-schema-slow-query.md) and `INFORMATION_SCHEMA.CLUSTER_SLOW_QUERY`.
- You can control the size of `Session_connect_attrs` recorded in the slow log by adjusting this variable.
- The value `-1` means no configured limit and is treated as up to `65536` bytes in TiDB.
From 60412badf33b3312fa0dd89eff4ed87f5bfc6349 Mon Sep 17 00:00:00 2001
From: jiong-nba <2301210292@stu.pku.edu.cn>
Date: Thu, 26 Mar 2026 15:21:25 +0800
Subject: [PATCH 05/15] docs: add MONITOR keyword
---
keywords.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/keywords.md b/keywords.md
index 5b080f17fb632..33354e4137959 100644
--- a/keywords.md
+++ b/keywords.md
@@ -449,6 +449,7 @@ The following list shows the keywords in TiDB. Reserved keywords are marked with
- MOD (R)
- MODE
- MODIFY
+- MONITOR
- MONTH
N
From f40e46f5668125a310c7bed2adec4ec3c280ee43 Mon Sep 17 00:00:00 2001
From: jiong-nba <2301210292@stu.pku.edu.cn>
Date: Thu, 26 Mar 2026 15:32:51 +0800
Subject: [PATCH 06/15] Revert "docs: add MONITOR keyword"
This reverts commit 60412badf33b3312fa0dd89eff4ed87f5bfc6349.
---
keywords.md | 1 -
1 file changed, 1 deletion(-)
diff --git a/keywords.md b/keywords.md
index 33354e4137959..5b080f17fb632 100644
--- a/keywords.md
+++ b/keywords.md
@@ -449,7 +449,6 @@ The following list shows the keywords in TiDB. Reserved keywords are marked with
- MOD (R)
- MODE
- MODIFY
-- MONITOR
- MONTH
N
From ba42f5fb74c4bd9e35dc07906e4fee87bd5808d0 Mon Sep 17 00:00:00 2001
From: houfaxin
Date: Thu, 26 Mar 2026 21:11:57 +0800
Subject: [PATCH 07/15] Update system-variables.md
---
system-variables.md | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/system-variables.md b/system-variables.md
index 305a0d5e340dd..d65cb2febec74 100644
--- a/system-variables.md
+++ b/system-variables.md
@@ -789,6 +789,20 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count';
1 row in set (0.00 sec)
```
+### pd_enable_follower_handle_region New in v7.6.0
+
+- Scope: GLOBAL
+- Persists to cluster: Yes
+- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
+- Type: Boolean
+- Default value: `ON`. Before v9.0.0, the default value is `OFF`.
+- This variable controls whether to enable the [Active PD Follower](https://docs.pingcap.com/tidb/stable/tune-region-performance#use-the-active-pd-follower-feature-to-enhance-the-scalability-of-pds-region-information-query-service) feature, which currently only applicable to requests for Region information.
+ - When it is `OFF`, TiDB only obtains Region information from the PD leader.
+ - When it is `ON`, TiDB evenly distributes Region information requests to all PD servers, so PD followers can also handle Region requests, reducing the CPU pressure on the PD leader. Starting from v9.0.0, Region information requests from TiDB Lightning are also evenly sent to all PD nodes when the value is `ON`.
+- Scenarios for enabling Active PD Follower:
+ * In a cluster with a large number of Regions, the PD leader experiences high CPU pressure due to the increased overhead of handling heartbeats and scheduling tasks.
+ * In a TiDB cluster with many TiDB instances, the PD leader experiences high CPU pressure due to a high concurrency of requests for Region information.
+
### performance_schema_session_connect_attrs_size New in v9.0.0
- Scope: GLOBAL
@@ -809,20 +823,6 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count';
>
> TiDB enforces a hard limit of 1 MiB for handshake connection attributes. If this hard limit is exceeded, the connection is rejected.
-### pd_enable_follower_handle_region New in v7.6.0
-
-- Scope: GLOBAL
-- Persists to cluster: Yes
-- Applies to hint [SET_VAR](/optimizer-hints.md#set_varvar_namevar_value): No
-- Type: Boolean
-- Default value: `ON`. Before v9.0.0, the default value is `OFF`.
-- This variable controls whether to enable the [Active PD Follower](https://docs.pingcap.com/tidb/stable/tune-region-performance#use-the-active-pd-follower-feature-to-enhance-the-scalability-of-pds-region-information-query-service) feature, which currently only applicable to requests for Region information.
- - When it is `OFF`, TiDB only obtains Region information from the PD leader.
- - When it is `ON`, TiDB evenly distributes Region information requests to all PD servers, so PD followers can also handle Region requests, reducing the CPU pressure on the PD leader. Starting from v9.0.0, Region information requests from TiDB Lightning are also evenly sent to all PD nodes when the value is `ON`.
-- Scenarios for enabling Active PD Follower:
- * In a cluster with a large number of Regions, the PD leader experiences high CPU pressure due to the increased overhead of handling heartbeats and scheduling tasks.
- * In a TiDB cluster with many TiDB instances, the PD leader experiences high CPU pressure due to a high concurrency of requests for Region information.
-
### plugin_dir
> **Note:**
From b232a336534bdd64d8644f9e39dd40047dfc9ab6 Mon Sep 17 00:00:00 2001
From: xixirangrang
Date: Fri, 27 Mar 2026 09:26:17 +0800
Subject: [PATCH 08/15] Update
performance-schema/performance-schema-session-connect-attrs.md
---
performance-schema/performance-schema-session-connect-attrs.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/performance-schema/performance-schema-session-connect-attrs.md b/performance-schema/performance-schema-session-connect-attrs.md
index f6ee682eb4f4e..afc604db98eb3 100644
--- a/performance-schema/performance-schema-session-connect-attrs.md
+++ b/performance-schema/performance-schema-session-connect-attrs.md
@@ -77,6 +77,6 @@ TiDB uses the [`performance_schema_session_connect_attrs_size`](/system-variable
When the total size exceeds this limit, TiDB truncates excess attributes and adds `_truncated` to indicate the number of truncated bytes.
-The accepted connection attributes are also written to the `Session_connect_attrs` field in the slow log and can be queried from `INFORMATION_SCHEMA.SLOW_QUERY` and `INFORMATION_SCHEMA.CLUSTER_SLOW_QUERY`. To control the payload size written to the slow log, adjust `performance_schema_session_connect_attrs_size`.
+The accepted connection attributes are also written to the `Session_connect_attrs` field in the slow log and can be queried from [`INFORMATION_SCHEMA.SLOW_QUERY`](/information-schema/information-schema-slow-query.md) and `INFORMATION_SCHEMA.CLUSTER_SLOW_QUERY`. To control the payload size written to the slow log, adjust `performance_schema_session_connect_attrs_size`.
TiDB also enforces a hard limit of 1 MiB on connection attribute payload in handshake packets. If this hard limit is exceeded, the connection is rejected.
From 709852aaa52ba007038f7d56fa764d189dbb0ef4 Mon Sep 17 00:00:00 2001
From: xixirangrang
Date: Fri, 27 Mar 2026 09:40:04 +0800
Subject: [PATCH 09/15] Apply suggestions from code review
---
system-variable-reference.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system-variable-reference.md b/system-variable-reference.md
index d5f2db378b997..045edaf1a658e 100644
--- a/system-variable-reference.md
+++ b/system-variable-reference.md
@@ -604,7 +604,7 @@ Referenced in:
Referenced in:
-- [SESSION_CONNECT_ATTRS](/performance-schema/performance-schema-session-connect-attrs.md)
+- [`SESSION_CONNECT_ATTRS`](/performance-schema/performance-schema-session-connect-attrs.md)
- [System Variables](/system-variables.md#performance_schema_session_connect_attrs_size-new-in-v900)
### plugin_dir
From b6693b24403d1f95ccaf6baaf3a23e72bfa4128e Mon Sep 17 00:00:00 2001
From: houfaxin
Date: Fri, 27 Mar 2026 11:58:49 +0800
Subject: [PATCH 10/15] Update tidb-storage.md
---
tidb-storage.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tidb-storage.md b/tidb-storage.md
index 04bb8f6931b7d..41a2256fddbd6 100644
--- a/tidb-storage.md
+++ b/tidb-storage.md
@@ -1,6 +1,6 @@
---
title: TiDB Storage
-summary: Understand the storage layer of a TiDB database.
+summary: Understand the storage layer of a TiDB database.
---
# TiDB Storage
From 370e31c19b318a72a9c0fe4c50d439d1574bda86 Mon Sep 17 00:00:00 2001
From: houfaxin
Date: Fri, 27 Mar 2026 12:14:21 +0800
Subject: [PATCH 11/15] Add storage architecture image; fix trailing space
Embed the TiDB storage architecture image into performance-schema-session-connect-attrs.md to provide a visual reference for the storage layout. Also remove an extraneous trailing space from the summary line in tidb-storage.md to clean up formatting.
---
performance-schema/performance-schema-session-connect-attrs.md | 2 ++
tidb-storage.md | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/performance-schema/performance-schema-session-connect-attrs.md b/performance-schema/performance-schema-session-connect-attrs.md
index afc604db98eb3..7f49a55be1bb4 100644
--- a/performance-schema/performance-schema-session-connect-attrs.md
+++ b/performance-schema/performance-schema-session-connect-attrs.md
@@ -5,6 +5,8 @@ summary: Learn the `SESSION_CONNECT_ATTRS` performance_schema table.
# SESSION\_CONNECT\_ATTRS
+
+
The `SESSION_CONNECT_ATTRS` table provides information about connection attributes. Session attributes are key-value pairs that are sent by the client when establishing a connection.
Common attributes:
diff --git a/tidb-storage.md b/tidb-storage.md
index 41a2256fddbd6..04bb8f6931b7d 100644
--- a/tidb-storage.md
+++ b/tidb-storage.md
@@ -1,6 +1,6 @@
---
title: TiDB Storage
-summary: Understand the storage layer of a TiDB database.
+summary: Understand the storage layer of a TiDB database.
---
# TiDB Storage
From b0d867644a4a3284ad320a7d9e8f6f27237b7fff Mon Sep 17 00:00:00 2001
From: houfaxin
Date: Fri, 27 Mar 2026 12:19:04 +0800
Subject: [PATCH 12/15] Update performance-schema-session-connect-attrs.md
---
performance-schema/performance-schema-session-connect-attrs.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/performance-schema/performance-schema-session-connect-attrs.md b/performance-schema/performance-schema-session-connect-attrs.md
index 7f49a55be1bb4..4fd3f3746faaa 100644
--- a/performance-schema/performance-schema-session-connect-attrs.md
+++ b/performance-schema/performance-schema-session-connect-attrs.md
@@ -7,6 +7,8 @@ summary: Learn the `SESSION_CONNECT_ATTRS` performance_schema table.

+
+
The `SESSION_CONNECT_ATTRS` table provides information about connection attributes. Session attributes are key-value pairs that are sent by the client when establishing a connection.
Common attributes:
From decc5e1c06806d844fc960ef74286a80ef2ee033 Mon Sep 17 00:00:00 2001
From: houfaxin
Date: Fri, 27 Mar 2026 13:09:36 +0800
Subject: [PATCH 13/15] Update performance-schema-session-connect-attrs.md
---
.../performance-schema-session-connect-attrs.md | 4 ----
1 file changed, 4 deletions(-)
diff --git a/performance-schema/performance-schema-session-connect-attrs.md b/performance-schema/performance-schema-session-connect-attrs.md
index 4fd3f3746faaa..afc604db98eb3 100644
--- a/performance-schema/performance-schema-session-connect-attrs.md
+++ b/performance-schema/performance-schema-session-connect-attrs.md
@@ -5,10 +5,6 @@ summary: Learn the `SESSION_CONNECT_ATTRS` performance_schema table.
# SESSION\_CONNECT\_ATTRS
-
-
-
-
The `SESSION_CONNECT_ATTRS` table provides information about connection attributes. Session attributes are key-value pairs that are sent by the client when establishing a connection.
Common attributes:
From bbe22ef49d7235670c49a37d9341b7a5f77c06f2 Mon Sep 17 00:00:00 2001
From: xixirangrang
Date: Fri, 27 Mar 2026 13:25:19 +0800
Subject: [PATCH 14/15] Update
performance-schema/performance-schema-session-connect-attrs.md
---
performance-schema/performance-schema-session-connect-attrs.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/performance-schema/performance-schema-session-connect-attrs.md b/performance-schema/performance-schema-session-connect-attrs.md
index afc604db98eb3..b1316ac1335c6 100644
--- a/performance-schema/performance-schema-session-connect-attrs.md
+++ b/performance-schema/performance-schema-session-connect-attrs.md
@@ -74,6 +74,7 @@ TiDB uses the [`performance_schema_session_connect_attrs_size`](/system-variable
- Default value: `4096` bytes
- Range: `[-1, 65536]`
- `-1` means no configured limit, and TiDB treats it as up to `65536` bytes.
+- `0`, means that TiDB does not retain client-provided session connection attributes, which effectively disables recording session attributes.
When the total size exceeds this limit, TiDB truncates excess attributes and adds `_truncated` to indicate the number of truncated bytes.
From e9ad9ae9f08dc13e646045e2abb599740bbe0abc Mon Sep 17 00:00:00 2001
From: Lilian Lee
Date: Mon, 30 Mar 2026 15:42:31 +0800
Subject: [PATCH 15/15] Update format and order of list content
Co-authored-by: Lilian Lee
---
.../performance-schema-session-connect-attrs.md | 2 +-
system-variables.md | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/performance-schema/performance-schema-session-connect-attrs.md b/performance-schema/performance-schema-session-connect-attrs.md
index b1316ac1335c6..a3c3c28116d81 100644
--- a/performance-schema/performance-schema-session-connect-attrs.md
+++ b/performance-schema/performance-schema-session-connect-attrs.md
@@ -74,7 +74,7 @@ TiDB uses the [`performance_schema_session_connect_attrs_size`](/system-variable
- Default value: `4096` bytes
- Range: `[-1, 65536]`
- `-1` means no configured limit, and TiDB treats it as up to `65536` bytes.
-- `0`, means that TiDB does not retain client-provided session connection attributes, which effectively disables recording session attributes.
+- `0` means that TiDB does not retain client-provided session connection attributes, which effectively disables recording session attributes.
When the total size exceeds this limit, TiDB truncates excess attributes and adds `_truncated` to indicate the number of truncated bytes.
diff --git a/system-variables.md b/system-variables.md
index d65cb2febec74..b473bb874f0c4 100644
--- a/system-variables.md
+++ b/system-variables.md
@@ -814,10 +814,10 @@ mysql> SHOW GLOBAL VARIABLES LIKE 'max_prepared_stmt_count';
- Unit: Bytes
- Controls the maximum total size of connection attributes for each session.
- If the total size of connection attributes exceeds this value, TiDB truncates excess attributes and adds `_truncated` to indicate the number of truncated bytes.
-- If the value is set to `0`, TiDB does not retain client-provided session connection attributes, which effectively disables recording session attributes.
- Connection attributes accepted within this limit are written to the `Session_connect_attrs` field in the slow log and can be queried from [`INFORMATION_SCHEMA.SLOW_QUERY`](/information-schema/information-schema-slow-query.md) and `INFORMATION_SCHEMA.CLUSTER_SLOW_QUERY`.
- You can control the size of `Session_connect_attrs` recorded in the slow log by adjusting this variable.
-- The value `-1` means no configured limit and is treated as up to `65536` bytes in TiDB.
+- If the value is set to `-1`, this means the limit is not configured and TiDB treats it as up to `65536` bytes.
+- If the value is set to `0`, TiDB does not retain client-provided session connection attributes, which effectively disables recording session attributes.
> **Note:**
>