以下查询很快:
SELECT *
FROM apple
LEFT JOIN banana b1
ON apple.id = b1.one
LEFT JOIN banana b2
ON apple.id = b2.two
WHERE b1.id IS NULL
AND b2.is IS NULL
虽然以下内容很慢:
SELECT *
FROM apple
LEFT JOIN banana
ON apple.id = banana.one
OR apple.id = banana.two
WHERE banana.id IS NULL
谁能解释为什么用“或”做“加入”语句比加入两个表要慢得多?