In a large query, I have
INNER JOIN file
ON ( file.file_id = temp_student_table.converted_file
OR file.file_id = temp_student_table.uploaded_file)
If file.file_id = temp_student_table.converted_file is a match, does MySQL check for the second statement? what happens if both of them return a match? Does it only consider the first statement?
In an
ORcondition, it will just evaluate the first condition and exit if it is already true.OR operator has this behaviour:
This means the
A OR Bis true unless A and B are false. For this,A OR Bwill evaluate the minimum necessary: ifAis already true, there is no point in continuing to evaluate the condition.