Left join will not be more efficient than inner join in any scenario, because in addition to the result set of all inner join, left join also needs all the unassociated data in the left table
In addition to requiring the associated fields to have indexes, left join is best to use a small table as the left table, because the number of retrieval cycles is fewer. The premise is that your business logic is OK, because different writing methods have different logics
Inner join will automatically select the appropriate table as the base table, and it still requires related field indexes, and it is best to use int type retrieval for higher efficiency
To be honest, the direction you asked the question is not quite right. . . It’s just the restriction conditions and indexes, but the query is reasonable, and the speed is very fast inner join is not based on anyone, it displays the data that meets the conditions left join is based on the left, and connects the right table
In terms of efficiency, it is definitely faster to connect a small table to a large table Deepen your understanding of the query plan from a MySQL left join optimization example
Left join will not be more efficient than inner join in any scenario, because in addition to the result set of all inner join, left join also needs all the unassociated data in the left table
In addition to requiring the associated fields to have indexes, left join is best to use a small table as the left table, because the number of retrieval cycles is fewer. The premise is that your business logic is OK, because different writing methods have different logics
Inner join will automatically select the appropriate table as the base table, and it still requires related field indexes, and it is best to use int type retrieval for higher efficiency
To be honest, the direction you asked the question is not quite right. . .
It’s just the restriction conditions and indexes, but the query is reasonable, and the speed is very fast
inner join is not based on anyone, it displays the data that meets the conditions
left join is based on the left, and connects the right table
In terms of efficiency, it is definitely faster to connect a small table to a large table
Deepen your understanding of the query plan from a MySQL left join optimization example