我刚刚读了一篇优化文章的一部分和 被切断了关于以下陈述的内容:
当使用带有
UNION的OR替换 SQL 语句时:select username from users where company = ‘bbc’ or company = ‘itv’;致:
select username from users where company = ‘bbc’ union select username from users where company = ‘itv’;
从一个简短的 EXPLAIN:
使用 OR:

使用 UNION:

这是不是意味着 UNION在 加倍工作量做?
虽然我认为 UNION对于某些 RDBMS 和某些表模式来说可能性能更好,但是这不是作者建议的 绝对正确。
我说错了吗?