MySQL Forums
Forum List  »  Newbie

LEFT JOIN vs INNER JOIN speeds
Posted by: John Tan
Date: March 19, 2023 01:03AM

Hello

i am wondering why on some database LEFT JOIN is faster
but on some other database INNER JOIN is faster ?

for the purpose of this test, NONE OF THE DATABASES have indexes
for the purpose of this test, we are selecting all fields


[DATABASE NORTHERN_COMPANY]

SELECT * FROM PAYMENTS LEFT JOIN PAYMENTS_DETAILS
ON PAYMENTS.PAY_ID = PAYMENTS_DETAILS.PAY_ID
- took 26 seconds

SELECT * FROM PAYMENTS ,PAYMENTS_DETAILS
WHERE PAYMENTS.PAY_ID = PAYMENTS_DETAILS.PAY_ID
- took 11 seconds


[DATABASE SOUTHERN_COMPANY]

using the same query above in a SOUTHERN_COMPANY results in LEFT JOIN becoming faster than INNER JOIN...

why is that ?

Options: ReplyQuote


Subject
Written By
Posted
LEFT JOIN vs INNER JOIN speeds
March 19, 2023 01:03AM


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.