The term ' association ' in MySQL contains a broader sense than the general sense. In general, MySQL considers any query to be an ' association '--not just a query needs to match two tables to be called associations, indexed in MySQL, every query, every fragment (including subqueries, setting up a form-based select) can be associated.
Therefore, it is important to understand how MySQL executes associated queries. Let's look at an example of a union query first. For union queries, MySQL first puts a series of individual query results into a temporary table, and then reads the temporary table data again to complete the union query. In the MySQL concept, each query is an association, so the temporary table that reads the results is also associated.
The current MySQL association execution strategy is simple: MySQL performs a nested association operation on any association, that is, MySQL loops through a table to read a single piece of data, and then finds a matching row in the nested loop to the next table, sequentially until it finds that the matching results in all the tables are unknown. The columns that are required in the query are then returned based on the rows that match each table. MySQL tries to find all the matching rows in the last associated table, and if the last associated table cannot find more rows, MySQL returns to the previous association table to see if more matching records can be found, and so on.
How MySQL executes the associated query