sql executes sequential from,on,join. reference article
there are two tables, posts 10000 data, post_slugs 14 records, and posts, two tables are associated by post_id. Use mysql
SELECT * from posts,post_slugs where post_slugs.post_id=posts.post_id
, in the order of sql execution, from is followed by the Dikal product of two tables, so the data actually operated by the where condition should be 10000X14 records.
SELECT * from posts join post_slugs on post_slugs.post_id=posts.post_id
in the order of sql execution, from reads the data of the posts table to generate a virtual table T1, and according to the on condition to read the data that post_slugs meets the conditions to generate a virtual table T2, and then according to the join method, insert the data that needs to be retained. In fact, the amount of data after join should be 14 records.
however, there is actually no difference in execution time between the two statements. Is this because the mysql optimizer handles it or is the execution sequence misunderstood?