Skip to content

Commit

Permalink
Reformatted the Warning section about EXCHANGE partition
Browse files Browse the repository at this point in the history
  • Loading branch information
mjonss authored and TomShawn committed Jul 23, 2021
1 parent 12cea6d commit cefa29a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions partitioned-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -581,19 +581,19 @@ You can see that the inserted record `(NULL, 'mothra')` falls into the same part

For `LIST` and `RANGE` partitioned tables, you can add and drop partitions using the `ALTER TABLE <table name> ADD PARTITION (<partition specification>)` or `ALTER TABLE <table name> DROP PARTITION <list of partitions>` statement.

For `LIST and `RANGE` partitioned tables, `REORGANIZE PARTITION` is not yet supported.

For `HASH` partitioned tables, `COALESCE PARTITION` and `ADD PARTITION` are not yet supported.

`REORGANIZE PARTITION` is not yet supported.
`EXCHANGE PARTITION` works by swapping a partition and a non-partitioned table, similar to how renaming a table like `RENAME TABLE t1 TO t1_tmp, t2 TO t1, t1_tmp TO t2` works.

- As an example: `ALTER TABLE partitioned_table EXCHANGE PARTITION p1 WITH TABLE non_partitioned_table`, swaps the table `non_partitioned_table` with the partition `p1` in the `partitioned_table` table.

Please be sure that all rows you are exchanging into the partition are matching the partition definition, or else they will not be found and there may be other issues.

> **Warning:**
>
> - `EXCHANGE PARTITION` is an experimental feature. It is not recommended to use it in a production environment. To enable it, set the `tidb_enable_exchange_partition` system variable to `ON`.
>
> - `EXCHANGE PARTITION` works by swapping a partition and a non-partitioned table, similar to how renaming a table like `RENAME TABLE t1 TO t1_tmp, t2 TO t1, t1_tmp TO t2` works.
>
> - As an example: `ALTER TABLE partitioned_table EXCHANGE PARTITION p1 WITH TABLE non_partitioned_table`, swaps the table `non_partitioned_table` with the partition `p1` in the `partitioned_table` table.
>
> Please be sure that all rows you are exchanging into the partition are matching the partition definition, or else they will not be found and there may be other issues.
> - `EXCHANGE PARTITION` is an experimental feature. It is not yet recommended to use it in a production environment. To enable it, set the `tidb_enable_exchange_partition` system variable to `ON`.
### Range partition management

Expand Down

0 comments on commit cefa29a

Please sign in to comment.