MySQL combines performance and correlated queries

I am wondering if a β€œnormal” inner join will lead to higher execution performance in MySQL queries than a simplified query, where you list all the tables and then join them to β€œand t1.t2id = t2.id”, etc. ..

+4
source share
1 answer

The execution plan and lead time are the same. One of them is called the ANSI style (INNER JOIN, LEFT, RIGHT), the other is called Theta style.

These two queries are equivalent in all respects to the mysql server

SELECT * FROM A INNER JOIN B ON A.ID = B.ID; SELECT * FROM A, B WHERE A.ID = B.ID; 

You can verify this by typing EXPLAIN before both queries, and the returned result should be the same.

+6
source

All Articles