the difference between left join and inner join and optimization

Queries related summary, left join and inner join differences and optimization

 

No study has been left join and inner join thin, and now find to do is really optimized to be familiar with the difference between them for the job.

Forgive Reprinted from: https: //blog.csdn.net/empire_knight/article/details/82021648

 

left join is left to do outside the association, the main table of contents will be displayed; Schedule content will meet the conditions associated with the show.

association within an inner join, there is no concept of a master schedule table; two tables, while meeting conditions associated data will be displayed.

 

left join is a short form of the left outer join.

join is a short form of inner join.

optimization:

As we all know, sql try to use a small amount of data tables table call the shots, so that high efficiency, but sometimes because logic requires that, to use a large amount of data tables table call the shots, this time using left join will be relatively slow, even though the associated conditions index. In this case we must consider is not able to use the inner join. Because the inner join in the implementation of automatic selection back to the table to do a minimum of basic tables, high efficiency

Guess you like

Origin www.cnblogs.com/Koy/p/11544329.html