-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document performance_schema.session_connect_attrs system table (#14616)
- Loading branch information
Showing
4 changed files
with
124 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
performance-schema/performance-schema-session-connect-attrs.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
--- | ||
title: SESSION_CONNECT_ATTRS | ||
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: | ||
|
||
| Attribute Name | Example | Description | | ||
|-------------------|---------------|----------------------------| | ||
| `_client_name` | `libmysql` | Client library name | | ||
| `_client_version` | `8.0.33` | Client library version | | ||
| `_os` | `Linux` | Operating System | | ||
| `_pid` | `712927` | Process ID | | ||
| `_platform` | `x86_64` | CPU Architecture | | ||
| `program_name` | `mysqlsh` | Program name | | ||
|
||
You can view the columns of the `SESSION_CONNECT_ATTRS` table as follows: | ||
|
||
{{< copyable "sql" >}} | ||
|
||
```sql | ||
USE performance_schema; | ||
DESCRIBE session_connect_attrs; | ||
``` | ||
|
||
``` | ||
+------------------+---------------------+------+-----+---------+-------+ | ||
| Field | Type | Null | Key | Default | Extra | | ||
+------------------+---------------------+------+-----+---------+-------+ | ||
| PROCESSLIST_ID | bigint(20) unsigned | NO | | NULL | | | ||
| ATTR_NAME | varchar(32) | NO | | NULL | | | ||
| ATTR_VALUE | varchar(1024) | YES | | NULL | | | ||
| ORDINAL_POSITION | int(11) | YES | | NULL | | | ||
+------------------+---------------------+------+-----+---------+-------+ | ||
``` | ||
|
||
You can view the information on session attributes stored in the `SESSION_CONNECT_ATTRS` table as follows: | ||
|
||
{{< copyable "sql" >}} | ||
|
||
```sql | ||
USE performance_schema; | ||
TABLE SESSION_CONNECT_ATTRS; | ||
``` | ||
|
||
``` | ||
+----------------+-----------------+------------+------------------+ | ||
| PROCESSLIST_ID | ATTR_NAME | ATTR_VALUE | ORDINAL_POSITION | | ||
+----------------+-----------------+------------+------------------+ | ||
| 2097154 | _client_name | libmysql | 0 | | ||
| 2097154 | _client_version | 8.1.0 | 1 | | ||
| 2097154 | _os | Linux | 2 | | ||
| 2097154 | _pid | 1299203 | 3 | | ||
| 2097154 | _platform | x86_64 | 4 | | ||
| 2097154 | program_name | mysqlsh | 5 | | ||
+----------------+-----------------+------------+------------------+ | ||
``` | ||
|
||
Fields in the `SESSION_CONNECT_ATTRS` table are described as follows: | ||
|
||
* `PROCESSLIST_ID`: Processlist ID of the session. | ||
* `ATTR_NAME`: Attribute name. | ||
* `ATTR_VALUE`: Attribute value. | ||
* `ORDINAL_POSITION`: Ordinal position of the name/value pair. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
title: Performance Schema | ||
summary: TiDB implements the performance_schema for viewing system metadata. | ||
--- | ||
|
||
# Performance Schema | ||
|
||
TiDB implements performance schema tables for MySQL compatibility. | ||
|
||
## Tables for MySQL compatibility | ||
|
||
| Table Name | Description | | ||
|--------------------------------------------------------------------------------------------------|-----------------------------------------------------------| | ||
| `events_stages_current` | | | ||
| `events_stages_history` | | | ||
| `events_stages_history_long` | | | ||
| `events_statements_current` | | | ||
| `events_statements_history` | | | ||
| `events_statements_history_long` | | | ||
| `events_statements_summary_by_digest` | | | ||
| `events_transactions_current` | | | ||
| `events_transactions_history` | | | ||
| `events_transactions_history_long` | | | ||
| `global_status` | | | ||
| `prepared_statements_instances` | | | ||
| [`session_connect_attrs`](/performance-schema/performance-schema-session-connect-attrs.md) | Provides connection attributes for sessions. | | ||
| `session_status` | | | ||
| `session_variables` | | | ||
| `setup_actors` | | | ||
| `setup_consumers` | | | ||
| `setup_instruments` | | | ||
| `setup_objects` | | | ||
|
||
## Tables that are TiDB extensions | ||
|
||
| Table Name | Description | | ||
|--------------------------------------------------------------------------------------------------|-----------------------------------------------------------| | ||
| `pd_profile_allocs` | | | ||
| `pd_profile_block` | | | ||
| `pd_profile_cpu` | | | ||
| `pd_profile_goroutines` | | | ||
| `pd_profile_memory` | | | ||
| `pd_profile_mutex` | | | ||
| `tidb_profile_allocs` | | | ||
| `tidb_profile_block` | | | ||
| `tidb_profile_cpu` | | | ||
| `tidb_profile_goroutines` | | | ||
| `tidb_profile_memory` | | | ||
| `tidb_profile_mutex` | | | ||
| `tikv_profile_cpu` | | |