A JOIN B与B JOIN A [英] A JOIN B vs B JOIN A
问题描述
当处理大型数据集时,表A与行B相比,行数要少得多.将表 A 与 B 和 B 和下面的查询中的 A
when dealing with large datasets where Table A has considerably very less no of rows when compared to B. Is there any difference between joining Table A with B and B with A in the query below
从 A 内联接 B 中选择A.col_PK,B.col_PK A.col_PK = A.col_PK WHERE A.col_2 ="0001";
SELECT A.col_PK , B.col_PK FROM A INNER JOIN B ON A.col_PK = A.col_PK WHERE A.col_2 = "0001";
推荐答案
发表评论的时间过长.
对于INNER JOIN
,功能上没有区别(顺序确实对外部联接有所影响).为了提高性能,优化器通常选择最佳顺序.
For an INNER JOIN
, there is no difference in functionality (order does make a difference for outer joins). For performance, the optimizer generally chooses the best ordering.
在某些情况下,当查询具有较长的连接序列时,优化器可能无法考虑所有选项.在这种情况下,排序可以改变性能.
Under some circumstances, when your query has long sequences of joins, the optimizer may not be able to consider all options. In those cases, the ordering could make a difference to the performance.
这篇关于A JOIN B与B JOIN A的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!