例如1:
select T1.*, T2.*
from TABLE1 T1, TABLE2 T2
where T1.id = T2.id
and T1.name = 'foo'
and T2.name = 'bar';
那会先通过id将T1和T2连接在一起,然后选择满足name条件的记录?或者在T1或T2中选择满足名称条件的记录,然后将它们连接在一起?
而且,example1 和 example2(DB2) 之间的性能是否存在差异?
示例2:
select *
from
(
select * from TABLE1 T1 where T1.name = 'foo'
) A,
(
select * from TABLE2 T2 where T2.name = 'bar'
) B
where A.id = B.id;