-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
reference/system-databases: add description for TIDB_ROW_ID_SHARDING_INFO
#2237
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -434,28 +434,29 @@ SELECT * FROM tables WHERE table_schema='mysql' AND table_name='user'; | |
|
||
``` | ||
*************************** 1. row *************************** | ||
TABLE_CATALOG: def | ||
TABLE_SCHEMA: mysql | ||
TABLE_NAME: user | ||
TABLE_TYPE: BASE TABLE | ||
ENGINE: InnoDB | ||
VERSION: 10 | ||
ROW_FORMAT: Compact | ||
TABLE_ROWS: 0 | ||
AVG_ROW_LENGTH: 0 | ||
DATA_LENGTH: 0 | ||
MAX_DATA_LENGTH: 0 | ||
INDEX_LENGTH: 0 | ||
DATA_FREE: 0 | ||
AUTO_INCREMENT: 0 | ||
CREATE_TIME: 2019-03-29 09:17:27 | ||
UPDATE_TIME: NULL | ||
CHECK_TIME: NULL | ||
TABLE_COLLATION: utf8mb4_bin | ||
CHECKSUM: NULL | ||
CREATE_OPTIONS: | ||
TABLE_COMMENT: | ||
TIDB_TABLE_ID: 5 | ||
TABLE_CATALOG: def | ||
TABLE_SCHEMA: mysql | ||
TABLE_NAME: user | ||
TABLE_TYPE: BASE TABLE | ||
ENGINE: InnoDB | ||
VERSION: 10 | ||
ROW_FORMAT: Compact | ||
TABLE_ROWS: 0 | ||
AVG_ROW_LENGTH: 0 | ||
DATA_LENGTH: 0 | ||
MAX_DATA_LENGTH: 0 | ||
INDEX_LENGTH: 0 | ||
DATA_FREE: 0 | ||
AUTO_INCREMENT: 0 | ||
CREATE_TIME: 2019-03-29 09:17:27 | ||
UPDATE_TIME: NULL | ||
CHECK_TIME: NULL | ||
TABLE_COLLATION: utf8mb4_bin | ||
CHECKSUM: NULL | ||
CREATE_OPTIONS: | ||
TABLE_COMMENT: | ||
TIDB_TABLE_ID: 5 | ||
TIDB_ROW_ID_SHARDING_INFO: NULL | ||
1 row in set (0.00 sec) | ||
``` | ||
|
||
|
@@ -477,6 +478,16 @@ SHOW TABLES | |
[LIKE 'wild'] | ||
``` | ||
|
||
表中的信息大部分定义自 MySQL,此外有两列是 TiDB 新增的: | ||
|
||
* `TiDB_TABLE_ID`:标识表的内部 ID,该 ID 在一个 TiDB 集群内部唯一。 | ||
* `TIDB_ROW_ID_SHARDING_INFO`:标识表的 Sharding 类型,可能的值为: | ||
- `"NOT_SHARDED"`:表未被 Shard。 | ||
- `"NOT_SHARDED(PK_IS_HANDLE)"`:一个定义了整型主键的表未被 Shard。 | ||
- `"PK_AUTO_RANDOM_BITS={bit_number}"`:一个定义了整型主键的表由于定义了 `AUTO_RANDOM` 而被 Shard。 | ||
- `"SHARD_BITS={bit_number}"`:表使用 `SHARD_ROW_ID_BITS={bit_number}` 进行了 Shard。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done, PTAL |
||
- NULL:表属于系统表或 View,无法被 Shard。 | ||
|
||
## TABLE_CONSTRAINTS 表 | ||
|
||
`TABLE_CONSTRAINTS` 表记录了表的约束信息。 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed, thanks.