Not sure which solution is good
In the book to see that is generally a sub-table query, in favor of caching
Reply content:
Not sure which solution is good
In the book to see that is generally a sub-table query, in favor of caching
Mainly look at the data volume, as well as the application scenario, the amount of data is small, the two almost
Where in () query or multi-table left JOIN union query, which is more efficient?
You're talking about a SQL problem, using a left join that's far more than using in.
The two syntaxes use a different scenario, in which the ID is used to filter out records that match your ID group, and the left join is the associated table. If I do paging, see if the associated table is a large table (hundreds of thousands of millions of records), and then decide whether to use a left join, even if it is best to use the join explain to see if it is optimal, no, look at the results of explain optimization. It is recommended that you do not join the super-large table, in words, extract the ID and query table assembly data into the main table data set without multiple loops, the efficiency is not necessarily slow to go.