Skip to content

Commit

Permalink
[docs feat]vuepress主题升级
Browse files Browse the repository at this point in the history
  • Loading branch information
Snailclimb committed Mar 31, 2024
1 parent 8d80bad commit 128ed38
Show file tree
Hide file tree
Showing 5 changed files with 761 additions and 726 deletions.
Binary file added dist.zip
Binary file not shown.
18 changes: 2 additions & 16 deletions docs/.vuepress/styles/palette.scss
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
$theme-color: #2980b9;
$sidebar-width: 20rem;
$sidebar-mobile-width: 16rem;
$font-family:
-apple-system,
Georgia,
SF Pro Text,
SF Pro Icons,
Helvetica Neue,
PingFangTC-light,
PingFang-SC-light;
$font-family-heading:
-apple-system,
Georgia,
SF Pro Text,
SF Pro Icons,
Helvetica Neue,
PingFangTC-light,
PingFang-SC-light;
$font-family: 'Georgia, -apple-system, "Nimbus Roman No9 L", "PingFang SC", "Hiragino Sans GB", "Noto Serif SC", "Microsoft Yahei", "WenQuanYi Micro Hei", sans-serif';
$font-family-heading: 'Georgia, -apple-system, "Nimbus Roman No9 L", "PingFang SC", "Hiragino Sans GB", "Noto Serif SC", "Microsoft Yahei", "WenQuanYi Micro Hei", sans-serif';
8 changes: 4 additions & 4 deletions docs/database/mysql/mysql-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ CREATE TABLE `user` (
SELECT * FROM user WHERE zipcode = '431200' AND MONTH(birthdate) = 3;
```

- 没有索引下推之前,即使 `zipcode` 字段利用索引可以帮助我们快速定位到 `zipcode = '431200'` 的用户,但我们仍然需要对每一个找到的用户进行回表操作,获取完整的用户数据,再去判断 `MONTH(birthdate) = 12`
- 有了索引下推之后,存储引擎会在使用`zipcode` 字段索引查找`zipcode = '431200'` 的用户时,同时判断`MONTH(birthdate) = 12`。这样,只有同时满足条件的记录才会被返回,减少了回表次数。
- 没有索引下推之前,即使 `zipcode` 字段利用索引可以帮助我们快速定位到 `zipcode = '431200'` 的用户,但我们仍然需要对每一个找到的用户进行回表操作,获取完整的用户数据,再去判断 `MONTH(birthdate) = 3`
- 有了索引下推之后,存储引擎会在使用`zipcode` 字段索引查找`zipcode = '431200'` 的用户时,同时判断`MONTH(birthdate) = 3`。这样,只有同时满足条件的记录才会被返回,减少了回表次数。

![](https://oss.javaguide.cn/github/javaguide/database/mysql/index-condition-pushdown.png)

Expand All @@ -427,11 +427,11 @@ MySQL 可以简单分为 Server 层和存储引擎层这两层。Server 层处
没有索引下推之前:

- 存储引擎层先根据 `zipcode` 索引字段找到所有 `zipcode = '431200'` 的用户的主键 ID,然后二次回表查询,获取完整的用户数据;
- 存储引擎层把所有 `zipcode = '431200'` 的用户数据全部交给 Server 层,Server 层根据`MONTH(birthdate) = 12`这一条件再进一步做筛选。
- 存储引擎层把所有 `zipcode = '431200'` 的用户数据全部交给 Server 层,Server 层根据`MONTH(birthdate) = 3`这一条件再进一步做筛选。

有了索引下推之后:

- 存储引擎层先根据 `zipcode` 索引字段找到所有 `zipcode = '431200'` 的用户,然后直接判断 `MONTH(birthdate) = 12`,筛选出符合条件的主键 ID;
- 存储引擎层先根据 `zipcode` 索引字段找到所有 `zipcode = '431200'` 的用户,然后直接判断 `MONTH(birthdate) = 3`,筛选出符合条件的主键 ID;
- 二次回表查询,根据符合条件的主键 ID 去获取完整的用户数据;
- 存储引擎层把符合条件的用户数据全部交给 Server 层。

Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@
},
"packageManager": "[email protected]",
"dependencies": {
"@vuepress/bundler-vite": "2.0.0-rc.6",
"@vuepress/plugin-copyright": "2.0.0-rc.11",
"@vuepress/plugin-feed": "2.0.0-rc.11",
"@vuepress/plugin-search": "2.0.0-rc.11",
"@vuepress/bundler-vite": "2.0.0-rc.9",
"@vuepress/plugin-copyright": "2.0.0-rc.21",
"@vuepress/plugin-feed": "2.0.0-rc.21",
"@vuepress/plugin-search": "2.0.0-rc.21",
"husky": "9.0.10",
"markdownlint-cli2": "0.12.1",
"mathjax-full": "3.2.2",
"nano-staged": "0.8.0",
"nodejs-jieba": "0.1.2",
"prettier": "3.2.5",
"vue": "3.4.15",
"vuepress": "2.0.0-rc.6",
"vuepress-theme-hope": "2.0.0-rc.22"
"vue": "^3.4.21",
"vuepress": "2.0.0-rc.9",
"vuepress-theme-hope": "2.0.0-rc.32"
}
}
Loading

0 comments on commit 128ed38

Please sign in to comment.