登录
首页 >  数据库 >  MySQL

MySQL中如何启用join buffer优化?

来源:亿速云

时间:2023-04-29 20:52:12 301浏览 收藏

golang学习网今天将给大家带来《MySQL中如何启用join buffer优化?》,感兴趣的朋友请继续看下去吧!以下内容将会涉及到等等知识点,如果你是正在学习数据库或者已经是大佬级别了,都非常欢迎也希望大家都能给我建议评论哈~希望能帮助到大家!

说明

1、在MySQL对于join操作的处理过程中,join buffer是一个重要的概念。

2、是MySQL对于table join的一个重要的优化手段。虽然这个概念实现并不复杂,但是这个是实现MySQL join连接优化的一个重要方法,在连接的时候可以极大提高join查询的效率。

实例

Table name      Type
t1              range
t2              ref
t3              ALL
The join is then done as follows:
 
- While rows in t1 matching range
 - Read through all rows in t2 according to reference key
  - Store used fields from t1, t2 in cache
  - If cache is full
    - Read through all rows in t3
      - Compare t3 row against all t1, t2 combinations in cache
        - If row satisfies join condition, send it to client
    - Empty cache
 
- Read through all rows in t3
 - Compare t3 row against all stored t1, t2 combinations in cache
   - If row satisfies join condition, send it to client

以上就是《MySQL中如何启用join buffer优化?》的详细内容,更多关于mysql的资料请关注golang学习网公众号!

声明:本文转载于:亿速云 如有侵犯,请联系study_golang@163.com删除
相关阅读
更多>
最新阅读
更多>
课程推荐
更多>