MySQL join performance vs correlated queries
I'm wondering if a 'normal' inner join leads to higher execution performance in MySQL queries than a simplistic query wh开发者_StackOverflowere you list all tables and then join them with 'and t1.t2id = t2.id' and so on ..
The execution plan and runtime is the same. One is called ANSI style (INNER JOIN, LEFT, RIGHT) the other is called Theta style.
These two queries are equivalent in every way to mysql server
SELECT * FROM A INNER JOIN B ON A.ID = B.ID;
SELECT * FROM A, B WHERE A.ID = B.ID;
You can test this by typing EXPLAIN in front of both queries and the result returned should be the same.
精彩评论