Home > Database > Mysql Tutorial > body text

How to implement join buffer in MySQL

王林
Release: 2023-05-27 12:55:06
forward
921 people have browsed it

Explanation

1. In MySQL's processing of join operations, join buffer is an important concept.

2. It is an important optimization method for table join in MySQL. Although the implementation of this concept is not complicated, it is an important method to realize MySQL join connection optimization, which can greatly improve the efficiency of join query when connecting.

Example

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
Copy after login

The above is the detailed content of How to implement join buffer in MySQL. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template