select name form userinfo where id=(select id from userdetail where phone='111')
select info.name form userinfo info,userdetail detail where detail.phone='111' and info.id=detail.id; 这两条语句效率一样么?

解决方案 »

  1.   

    减少访问数据库的次数 , 就能实际上减少ORACLE的工作量。第二个高点吧
      

  2.   

    请问执行计划怎么看啊? 
    这个效率是怎么看出哪个高的呢?是不是要懂数据库原理的东西?
    ---------------------------------------------------
    在sqlplus worksheet里面就可以看
    set autotrace on
    如果不想看结果,set autotrace traceonly
    但是执行计划地分析就要靠经验了最简单的看执行时间
    set timing on