For example:
SELECT * FROM table_1 LIMIT 5
LEFT JOIN table_2 AS table_1.id = table_2.id
WHERE 1
Otherwise the engine takes all of table_1 before applying the join, then limiting which can slow the query down massively (with massive tables).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do it by joining on a subquery instead of an actual table. Something like this should work: