您可以执行UNION of 2查询而不是OR.我知道在至少一个其他DBMS中这个速度快一个数量级的实例,并且我猜测MySQL的查询优化器可能共享相同的"特性".
SELECT whatever FROM votes v INNER JOIN users u ON v.user_id_1 = u.uid WHERE v.user_id_2 = 9834 AND v.votes_2 = 0 UNION SELECT whatever FROM votes v INNER JOIN users u ON v.user_id_2 = u.uid WHERE v.user_id_1 = 9834 AND v.votes_1 = 0 ORDER BY updated_at DESC