What’s the difference between these two queries:
SELECT `threads`.`id` AS `threads.id` , `posts`.`id` , `posts`.`content`
FROM `threads`
JOIN `posts` ON `threads`.`id` = `posts`.`thread_id`
And
SELECT `threads`.`id` AS `threads.id` , `posts`.`id` , `posts`.`content`
FROM `threads` , `posts`
WHERE `threads`.`id` = `posts`.`thread_id`
They both return same data.
WHEREclause filtering result set which is returned byJOIN, so this is a difference.As long as you are using
INNER JOINthere is no differences neither performance nor execution plan, in case of anyOUTER JOINquery would produce different execution plan.Also pay attention to what is said in the MySql online doc: