readme
This commit is contained in:
30
README.md
30
README.md
@@ -264,8 +264,7 @@ public class ChangeLogContext {
|
||||
|
||||
```mysql
|
||||
DROP TABLE IF EXISTS `your_table_name`;
|
||||
CREATE TABLE `your_table_name`
|
||||
(
|
||||
CREATE TABLE `your_table_name` (
|
||||
`guid` bigint(0) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'GUID',
|
||||
-- ----------------------------
|
||||
-- add your table other table field
|
||||
@@ -277,16 +276,35 @@ CREATE TABLE `your_table_name`
|
||||
`create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
|
||||
`update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '更新时间',
|
||||
PRIMARY KEY (`guid`) USING BTREE,
|
||||
-- UNIQUE KEY `idx_unique_key` (`you unique key`,`delete_token`) USING BTREE,
|
||||
KEY `idx_common_query` (`is_hidden`, `is_delete`, `create_time` desc, `guid`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '你的表格备注'
|
||||
ROW_FORMAT = Dynamic;
|
||||
```
|
||||
|
||||
### 索引优化指南
|
||||
|
||||
唯一键索引:
|
||||
|
||||
```
|
||||
UNIQUE KEY `idx_unique_key` (`you unique key`,`delete_token`) USING BTREE,
|
||||
-- KEY `idx_common_query` (
|
||||
-- 等值查询字段,
|
||||
-- `is_hidden`,`is_delete`,
|
||||
-- 其他参与排序字段,
|
||||
-- `create_time` desc,
|
||||
-- `guid`) USING BTREE
|
||||
KEY `idx_common_query` (`is_hidden`, `is_delete`, `create_time` desc, `guid`) USING BTREE
|
||||
) ENGINE = InnoDB COMMENT = '你的表格备注'
|
||||
ROW_FORMAT = Dynamic;
|
||||
```
|
||||
|
||||
查询索引:
|
||||
|
||||
```
|
||||
KEY `idx_common_query` (
|
||||
-- 等值查询字段,
|
||||
`is_hidden`,`is_delete`,
|
||||
-- 其他参与排序字段,
|
||||
`create_time` desc,
|
||||
`guid`
|
||||
) USING BTREE
|
||||
```
|
||||
|
||||
**必需字段说明**:
|
||||
|
||||
Reference in New Issue
Block a user