Skip to content

Commit c1b3a42

Browse files
committed
revise translation
1 parent d8d49a7 commit c1b3a42

5 files changed

Lines changed: 72 additions & 59 deletions

File tree

pd-configuration-file.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ Configuration items related to scheduling
295295
296296
### `max-affinity-merge-region-size` <span class="version-mark">Introduced in versions v8.5.5 and v9.0.0</span>
297297
298-
+ Controls the threshold for automatically merging small adjacent Regions that belong to the same [affinity](/table-affinity.md) group. When a Region belongs to an affinity group and its size is less than this configuration value, PD will attempt to merge this Region with other small adjacent Regions within the same affinity group to reduce the number of Regions and maintain the affinity effect.
298+
+ Controls the threshold for automatically merging small adjacent Regions that belong to the same [affinity](/table-affinity.md) group. When a Region belongs to an affinity group and its size is smaller than this threshold, PD attempts to merge this Region with other small adjacent Regions in the same affinity group to reduce the number of Regions and maintain the affinity effect.
299299
+ Setting it to `0` disables the automatic merging of small adjacent Regions within an affinity group.
300300
+ Default value: 256
301301
+ Unit: MiB
@@ -382,8 +382,8 @@ Configuration items related to scheduling
382382
383383
### `affinity-schedule-limit` <span class="version-mark">Introduced in versions v8.5.5 and v9.0.0</span>
384384
385-
+ Controls the number of concurrent [affinity](/table-affinity.md) scheduling tasks. Setting it to `0` disables affinity scheduling.
386-
+ Default value: 0
385+
+ Controls the number of [affinity](/table-affinity.md) scheduling tasks that can be performed concurrently. Setting it to `0` disables affinity scheduling.
386+
+ Default value: `0`
387387
388388
### `high-space-ratio`
389389

sql-statements/sql-statement-alter-table.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ AlterTableSpec ::=
5555
| TTLEnable EqOpt ( 'ON' | 'OFF' )
5656
| TTLJobInterval EqOpt stringLit
5757
)
58+
| 'AFFINITY' EqOpt stringLit
5859
| PlacementPolicyOption
5960
6061
PlacementPolicyOption ::=
@@ -182,7 +183,7 @@ The following major restrictions apply to `ALTER TABLE` in TiDB:
182183

183184
- Changes of some data types (for example, some TIME, Bit, Set, Enum, and JSON types) are not supported due to the compatibility issues of the `CAST` function's behavior between TiDB and MySQL.
184185

185-
- `AFFINITY` option is a TiDB extension syntax. After enabling `AFFINITY`, changing the table's partition scheme (e.g., adding, deleting, reorganizing, or swapping partitions) is not supported. You need to remove `AFFINITY` first.
186+
- `AFFINITY` option is a TiDB extension syntax. After `AFFINITY` is enabled for a table, modifying the partition scheme (such as adding, dropping, reorganizing, or swapping partitions) of that table is not supported. You need to remove `AFFINITY` first.
186187

187188
- Spatial data types are not supported.
188189

sql-statements/sql-statement-create-table.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,25 @@ The following *table_options* are supported. Other options such as `AVG_ROW_LENG
173173
| `CHARACTER SET` | To specify the [character set](/character-set-and-collation.md) for the table | `CHARACTER SET` = 'utf8mb4' |
174174
| `COLLATE` | To specify the character set collation for the table | `COLLATE` = 'utf8mb4_bin' |
175175
| `COMMENT` | The comment information | `COMMENT` = 'comment info' |
176-
| `AFFINITY` | Enables affinity scheduling for a table or partition. For non-partitioned tables, it can be set to `'table'`; for partitioned tables, it can be set to `'partition'`. Setting it to `'none'` or leaving it empty disables affinity scheduling. | `AFFINITY` = 'table' |
176+
| `AFFINITY` | Enables affinity scheduling for a table or partition. It can be set to `'table'` for non-partitioned tables and `'partition'` for partitioned tables. Setting it to `'none'` or leaving it empty disables affinity scheduling. | `AFFINITY` = 'table' |
177+
178+
<CustomContent platform="tidb">
177179

178180
> **Note:**
179181
>
180182
> - The `split-table` configuration option is enabled by default. When it is enabled, a separate Region is created for each newly created table. For details, see [TiDB configuration file](/tidb-configuration-file.md).
181-
> - When using `AFFINITY`, changing the partitioning scheme of a table (such as adding, deleting, reorganizing, or swapping partitions) is not supported, nor is setting this option on temporary tables or views.
183+
> - Before using `AFFINITY`, note that modifying the partitioning scheme (such as adding, dropping, reorganizing, or swapping partitions) of a table with affinity enabled is not supported, and configuring `AFFINITY` on temporary tables or views is not supported.
184+
185+
</CustomContent>
186+
187+
<CustomContent platform="tidb-cloud">
188+
189+
> **Note:**
190+
>
191+
> - TiDB creates a separate Region for each newly created table.
192+
> - Before using `AFFINITY`, note that modifying the partitioning scheme (such as adding, dropping, reorganizing, or swapping partitions) of a table with affinity enabled is not supported, and configuring `AFFINITY` on temporary tables or views is not supported.
193+
194+
</CustomContent>
182195

183196
## Examples
184197

sql-statements/sql-statement-show-affinity.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: SHOW AFFINITY
3-
summary: Overview of using SHOW AFFINITY in TiDB database.
3+
summary: An overview of the usage of SHOW AFFINITY for the TiDB database.
44
---
55

6-
# SHOW AFFINITY <span class="version-mark">Introduced in v8.5.5 and v9.0.0</span>
6+
# SHOW AFFINITY <span class="version-mark">New in v8.5.5 and v9.0.0</span>
77

8-
The `SHOW AFFINITY` statement is used to view the [affinity](/table-affinity.md) scheduling information of tables configured with the `AFFINITY` option, and the target replica distribution currently recorded by PD.
8+
The `SHOW AFFINITY` statement shows [affinity](/table-affinity.md) scheduling information for tables configured with the `AFFINITY` option, as well as the target replica distribution currently recorded by PD.
99

10-
## Grammar Diagram
10+
## Synopsis
1111

1212
```ebnf+diagram
1313
ShowAffinityStmt ::=
@@ -18,7 +18,7 @@ ShowAffinityStmt ::=
1818

1919
## Examples
2020

21-
The following examples create two tables with affinity scheduling enabled and view their scheduling information:
21+
The following examples create two tables with affinity scheduling enabled and show how to view their scheduling information:
2222

2323
```sql
2424
CREATE TABLE t1 (a INT) AFFINITY = 'table';
@@ -41,21 +41,21 @@ The example output is as follows:
4141

4242
The meaning of each column is as follows:
4343

44-
- `Leader_store_id`, `Voter_store_ids`: The TiKV Store IDs where PD records the target Leader replica and Voter replicas for this table or partition. If the affinity group has not yet determined the target replica locations or if [`schedule.affinity-schedule-limit`](/pd-configuration-file.md#affinity-schedule-limit-从-v855--v900-版本开始引入) is `0`, it displays as `NULL`.
45-
- `Status`: Indicates the current status of affinity scheduling. Possible values are:
46-
- `Pending`: PD has not yet performed affinity scheduling for this table or partition (e.g., when Leader or Voter is not determined).
44+
- `Leader_store_id`, `Voter_store_ids`: the IDs of TiKV stores recorded by PD, indicating which stores host the target Leader and Voter replicas for the table or partitions. If the target replica locations for the affinity group are not determined, or if [`schedule.affinity-schedule-limit`](/pd-configuration-file.md#affinity-schedule-limit-new-in-v855-and-v900) is set to `0`, the value is displayed as `NULL`.
45+
- `Status`: indicates the current status of affinity scheduling. Possible values are:
46+
- `Pending`: PD has not started affinity scheduling for the table or partition, such as when Leaders or Voters are not yet determined.
4747
- `Preparing`: PD is scheduling Regions to meet affinity requirements.
48-
- `Stable`: All Regions have reached the target distribution.
49-
- `Region_count`: The current number of Regions in this affinity group.
50-
- `Affinity_region_count`: The number of Regions that currently satisfy the affinity replica distribution requirements.
51-
- When `Affinity_region_count` is less than `Region_count`, it indicates that some Regions have not yet completed replica scheduling based on affinity.
52-
- When `Affinity_region_count` equals `Region_count`, it indicates that the Region replica migration scheduling based on affinity is complete, meaning that the distribution of all Regions meets the affinity requirements. However, this does not imply that related Region merge operations are complete.
48+
- `Stable`: all Regions have reached the target distribution.
49+
- `Region_count`: the current number of Regions in the affinity group.
50+
- `Affinity_region_count`: the number of Regions that currently meet the affinity replica distribution requirements.
51+
- When `Affinity_region_count` is less than `Region_count`, it indicates that some Regions have not yet completed affinity-replica scheduling.
52+
- When `Affinity_region_count` equals `Region_count`, it indicates that affinity-replica scheduling is complete, meaning the distribution of all related Regions meets the affinity requirements. However, it does not indicate that related Region merge operations are completed.
5353

54-
## MySQL Compatibility
54+
## MySQL compatibility
5555

56-
This statement is an extension of MySQL syntax by TiDB.
56+
This statement is a TiDB extension to MySQL syntax.
5757

58-
## See Also
58+
## See also
5959

6060
- [`CREATE TABLE`](/sql-statements/sql-statement-create-table.md)
6161
- [`ALTER TABLE`](/sql-statements/sql-statement-alter-table.md)

0 commit comments

Comments
 (0)