同事发来2个语句,说语句1跑得慢,语句2很快就出结果。一执行,果然很慢。仔细发现,2个语句不等价。
语句1:select l.*,o.object_name from v$locked_object l left join all_objects o on l.object_id=o.object_id;
select l.*,o.object_name from v$locked_object l,all_objects o where l.object_id=o.object_id;
select l.*,o.object_name from v$locked_object l,all_objects o where l.object_id=o.object_id(+);
select l.*,(select o.object_name from all_objects o where l.object_id=o.object_id) from v$locked_object l;
原文地址:http://blog.csdn.net/gdmzlhj1/article/details/39548589