MySQL Forums :: Performance :: JOIN ON vs WHERE

Advanced Search

Posted by: Vasanthakumar V ()
Date: March 17, 2011 02:56AM

Dear All,

Is there any difference performance wise when we run join queries using "JOIN ON" and "WHERE" clause? (regardless of the number of tables or the number of entries in the tables)

Not sure whether this topic has already been discussed over. Even if so, I wish to know whether with the latest versions of mySQL, things have changed.

An Explain statement clearly shows a lot of difference in the number of rows taken for consideration.

The Syntax I am using is:

SELECT <field names>
FROM <table1>
JOIN <table2> ON <join_condition>
AND JOIN <table3> ON <join_condition>
AND JOIN <table4> ON <join_condition>

SELECT <field names>
FROM <table names list separated by comma>
WHERE <join_condition>
AND <join_condition>
AND <join_condition>

So not sure whether usage of JOIN ON or WHERE clause would make a difference. Please assist.

Thanks and Best Regards,
Vasanthakumar V

Options: ReplyQuote

Subject Views Written By Posted
JOIN ON vs WHERE 2417 Vasanthakumar V 03/17/2011 02:56AM
Re: JOIN ON vs WHERE 884 Rick James 03/19/2011 12:21AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.