Skip to content

Commit c783a22

Browse files
committed
📝mysql
2 parents 5049516 + d603e5d commit c783a22

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
| Project | Version | Article |
3838
| :----------------------------------------------------------: | :-----: | :----------------------------------------------------------- |
39-
| ![](https://icongr.am/devicon//mysql-original.svg?size=20) **MySQL** | 5.7.25 | [1、MySQL架构概述](docs/mysql/MySQL-Framework.md)<br/>[2、MySQL存储引擎](docs/mysql/MySQL-Storage-Engines.md)<br/>[3、索引](docs/mysql/MySQL-Index.md)<br/>[4、事务](docs/mysql/MySQL-Transaction.md)<br/>5、表设计<br/>[6、性能优化](docs/mysql/MySQL-Optimization.md)<br/>7、锁机制<br/>8、分区分表分库<br/>9 、主从复制<br/> |
39+
| ![](https://icongr.am/devicon//mysql-original.svg?size=20) **MySQL** | 5.7.25 | [1、MySQL架构概述](docs/data-store/MySQL/MySQL-Framework.md)<br/>[2、MySQL存储引擎](docs/data-store/MySQL/MySQL-Storage-Engines.md)<br/>[3、索引](docs/data-store/MySQL/MySQL-Index.md)<br/>[4、事务](docs/data-store/MySQL/MySQL-Transaction.md)<br/>5、表设计<br/>[6、性能优化](docs/data-store/MySQL/MySQL-Optimization.md)<br/>7、锁机制<br/>8、分区分表分库<br/>9 、主从复制<br/> |
4040
| ![](https://icongr.am/devicon//redis-original.svg?size=20) **Redis** | 5.0.6 | [1、NoSQL概述](docs/data-store/Redis/1.Nosql-Overview.md)<br/>[2、Redis概述](docs/data-store/Redis/2.readRedis.md)<br/>[3、Redis数据类型](docs/data-store/Redis/3.Redis-Datatype.md)<br/>[4、Redis配置](docs/data-store/Redis/4.Redis-Conf.md)<br/>[5、深入理解 Redis 的持久化](docs/data-store/Redis/5.Redis-Persistence.md)<br/> |
4141
| **Elasticsearch** | | |
4242
| **Amazon S3** | | |
@@ -108,7 +108,7 @@
108108

109109
| Project | Article |
110110
| :------------------: | :----------------------------------------------------------- |
111-
| GoF 的 23 种设计模式 | [设计模式前传——要学设计模式你要先知道这些](/docs/design-pattern/Design-Pattern-Overview.md) <br/>[单例模式——我只有一个对象](/docs/design-pattern/Singleton-Pattern.md)<br/>[工厂模式——我有好多对象](/docs/design-pattern/Factory-Pattern.md)<br/>[观察者模式——暗中观察](/docs/design-pattern/Observer-Pattern.md)<br />[装饰者模式——拒绝继承滥用](/docs/design-pattern/Decorator-Pattern.md)<br />[责任链模式——更灵活的 if else](/docs/design-pattern/Chain-of-Responsibility-Pattern)<br>[代理模式——面试官问我Spring AOP中两种代理的区别](https://mp.weixin.qq.com/s/U7eR5Mpu4VBbtPP1livLnA)<br/> |
111+
| GoF 的 23 种设计模式 | [设计模式前传——要学设计模式你要先知道这些](/docs/design-pattern/Design-Pattern-Overview.md) <br/>[单例模式——我只有一个对象](/docs/design-pattern/Singleton-Pattern.md)<br/>[工厂模式——我有好多对象](/docs/design-pattern/Factory-Pattern.md)<br/>[观察者模式——暗中观察](/docs/design-pattern/Observer-Pattern.md)<br />[装饰者模式——拒绝继承滥用](/docs/design-pattern/Decorator-Pattern.md)<br />[责任链模式——更灵活的 if else](/docs/design-pattern/Chain-of-Responsibility-Pattern)<br>[代理模式——面试官问我Spring AOP中两种代理的区别](https://mp.weixin.qq.com/s/U7eR5Mpu4VBbtPP1livLnA)<br/>[原型模式——浅拷贝和深拷贝](http://mp.weixin.qq.com/s?__biz=MzIyNDI3MjY0NQ==&mid=2247485400&idx=1&sn=b83ef5d8d81e54bc46207bf540fc9cf9&chksm=e810cfb2df6746a41e10904fe43611e1385d406a95f680472e72620b91973f8724af9a4d8c37&token=1569764147&lang=zh_CN#rd)<br/> |
112112

113113

114114

docs/data-store/MySQL/MySQL-Index.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MySQL索引篇——妈妈再也不担心我不会索引了
1+
# MySQL索引篇——妈妈再也不用担心我不会索引了
22

33
>索引问题,在面试中是肯定会出现的,记一道知乎服务端面试题
44
>
@@ -12,7 +12,11 @@
1212

1313
- 可以简单的理解为“排好序的快速查找数据结构”,数据本身之外,<font color=#FF0000>**数据库还维护者一个满足特定查找算法的数据结构**</font>,这些数据结构以某种方式引用(指向)数据,这样就可以在这些数据结构上实现高级查找算法。这种数据结构,就是索引。下图是一种可能的索引方式示例。
1414

15+
<<<<<<< HEAD
1516
![](https://static01.imgkr.com/temp/5dda88d8f792449eb6ba7206265aab40.png)
17+
=======
18+
![](https://tva1.sinaimg.cn/large/007S8ZIlly1ghphshtu04j30gt08xmxn.jpg)
19+
>>>>>>> d603e5d78c0acfdf025b57e1fd861df9ad4d2ff7
1620
1721
左边的数据表,一共有两列七条记录,最左边的是数据记录的物理地址
1822

@@ -294,7 +298,7 @@ MyISAM 引擎的索引文件和数据文件是分离的。**MyISAM 引擎索引
294298

295299
我们知道 InnoDB 索引是聚集索引,它的索引和数据是存入同一个 `.idb` 文件中的,因此它的索引结构是在同一个树节点中同时存放索引和数据,如下图中最底层的叶子节点有三行数据,对应于数据表中的 id、stu_id、name数据项。
296300

297-
![img](https://tva1.sinaimg.cn/large/007S8ZIlly1gewoy2lhr5j320d0u016k.jpg)
301+
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gewoy2lhr5j320d0u016k.jpg)
298302

299303
在 Innodb 中,索引分叶子节点和非叶子节点,非叶子节点就像新华字典的目录,单独存放在索引段中,叶子节点则是顺序排列的,在数据段中。InnoDB 的数据文件可以按照表来切分(只需要开启`innodb_file_per_table)`,切分后存放在`xxx.ibd`中,默认不切分,存放在 `xxx.ibdata`中。
300304

@@ -309,7 +313,7 @@ MyISAM 引擎的索引文件和数据文件是分离的。**MyISAM 引擎索引
309313

310314
这也就是所谓的“**回表查询**
311315

312-
![img](https://tva1.sinaimg.cn/large/007S8ZIlly1gewsc7l623j320r0u0gwt.jpg)
316+
![](https://tva1.sinaimg.cn/large/007S8ZIlly1gewsc7l623j320r0u0gwt.jpg)
313317

314318
**InnoDB 索引结构需要注意的点**
315319

0 commit comments

Comments
 (0)