subquery

The reason for the card
is that the operation of the subquery will definitely create a temporary table. Of course, it is not terrible to create a temporary table in memory,
but when you have a large amount of data and the single table size of the temporary table in memory is limited, the temporary table will be converted to write.

The two parameters of the physical memory table in the form of disk determine the size of your temporary table
tmp_table_size max_heap_table_size

You can check the changes of these two states to see if there is any problem with your database statement.
Created_tmp_disk_tables/Created_tmp_tables<5%   

solution: As mentioned above, use the join syntax, and only use subqueries in specific situations 

 



 

 

 

refs:http://bbs.csdn.net/topics/390691898

        http://blog.csdn.net/jenminzhang/article/details/8861148

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326049531&siteId=291194637
Recommended