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

partitioned tables: add some restrictions (#18290) #18306

Merged
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions partitioned-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -1450,6 +1450,12 @@ SELECT store_id, COUNT(department_id) AS c

本节介绍当前 TiDB 分区表的一些约束和限制。

- 不支持使用 [`ALTER TABLE ... CHANGE COLUMN`](/sql-statements/sql-statement-change-column.md) 语句更改分区表的列类型。
- 不支持使用 [`ALTER TABLE ... CACHE`](/cached-tables.md) 语句将分区表设为缓存表。
- 与 TiDB 的[临时表](/temporary-tables.md)功能不兼容。
- 不支持在分区表上创建[外键](/foreign-key.md)。
- [`ORDER_INDEX(t1_name, idx1_name [, idx2_name ...])`](/optimizer-hints.md#order_indext1_name-idx1_name--idx2_name-) Hint 对分区表及其相关索引不生效,因为分区表上的索引不支持按顺序读取。

### 分区键,主键和唯一键

本节讨论分区键,主键和唯一键之间的关系。一句话总结它们之间的关系要满足的规则:**分区表的每个唯一键,必须包含分区表达式中用到的所有列**。
Expand Down
2 changes: 1 addition & 1 deletion sql-statements/sql-statement-create-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ mysql> DESC t1;
* 为了与 MySQL 兼容,TiDB 会解析但忽略 `index_col_name` 属性的 `[ASC | DESC]` 索引排序选项。
* `COMMENT` 属性不支持 `WITH PARSER` 选项。
* TiDB 在单个表中默认支持 1017 列,最大可支持 4096 列。InnoDB 中相应的数量限制为 1017 列,MySQL 中的硬限制为 4096 列。详情参阅 [TiDB 使用限制](/tidb-limitations.md)。
* 当前仅支持 Range、HashRange Columns(单列)类型的分区表,详情参阅[分区表](/partitioned-table.md)
* 分区表支持 `HASH`、`RANGE`、`LIST``KEY` [分区类型](/partitioned-table.md#分区类型)。对于不支持的分区类型,TiDB 会报 `Warning: Unsupported partition type %s, treat as normal table` 错误,其中 `%s` 为不支持的具体分区类型

## 另请参阅

Expand Down