Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tidb-configuration-file: add more notes to txn-entry-size-limit #10629

Merged
merged 6 commits into from Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions tidb-configuration-file.md
Expand Up @@ -362,6 +362,8 @@ Configuration items related to performance.
- Default value: `6291456` (in bytes)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In L361, do we need to mention this configuration item also controls the size limit of a single column?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's needed as this should be implicit as columns can't be bigger than the row.

- The size limit of a single key-value record in a transaction. If the size limit is exceeded, TiDB returns the `entry too large` error. The maximum value of this configuration item does not exceed `125829120` (120 MB).
- Note that TiKV has a similar limit. If the data size of a single write request exceeds [`raft-entry-max-size`](/tikv-configuration-file.md#raft-entry-max-size), which is 8 MB by default, TiKV refuses to process this request. When a table has a row of large size, you need to modify both configurations at the same time.
- The default value of [`max_allowed_packet`](/system-variables.md#max_allowed_packet-new-in-v610) (the maximum size of a packet for the MySQL protocol) is 67108864 (64 MiB). If a row is larger than `max_allowed_packet`, the row gets truncated.
- The default value of [`txn-total-size-limit`](#txn-total-size-limit) (the size limit of a single transaction in TiDB) is 100 MiB. If you increase the `txn-entry-size-limit` value to be over 100 MiB, you need to increase the `txn-total-size-limit` value accordingly.

### `txn-total-size-limit`

Expand Down
20 changes: 13 additions & 7 deletions tidb-limitations.md
Expand Up @@ -53,9 +53,9 @@ This document describes the common usage limitations of TiDB, including the maxi

## Limitation on a single row

| Type | Upper limit |
| Type | Upper limit (default value) |
|:----------|:----------|
| Size | 6 MB |
| Size | Defaults to 6 MiB and can be adjusted to 120 MiB |

<CustomContent platform="tidb">

Expand All @@ -65,20 +65,26 @@ You can adjust the size limit via the [`txn-entry-size-limit`](/tidb-configurati

## Limitation on a single column

| Type | Upper limit |
| Type | Upper limit (default value) |
|:----------|:----------|
| Size | 6 MB |
| Size | Defaults to 6 MiB and can be adjusted to 120 MiB |

<CustomContent platform="tidb">

You can adjust the size limit via the [`txn-entry-size-limit`](/tidb-configuration-file.md#txn-entry-size-limit-new-in-v50) configuration item.

</CustomContent>

## Limitations on string types
## Limitations on data types

| Type | Upper limit |
|:----------|:----------|
| CHAR | 256 characters |
| BINARY | 256 characters |
| VARBINARY | 65535 characters |
| VARCHAR | 16383 characters |
| TEXT | 6 MB |
| BLOB | 6 MB |
| TEXT | Defaults to 6 MiB and can be adjusted to 120 MiB |
| BLOB | Defaults to 6 MiB and can be adjusted to 120 MiB |

## Limitations on SQL statements

Expand Down