两个表的记录数相差比较大吧?
from表的顺序是需要注意的。

解决方案 »

  1.   

    是你多定位了a.cont_id=12 的缘故,你t_acct表影响你的查询速度
      

  2.   

    同意楼上,b.cont_id=a.cont_id的结果集非常的大。
      

  3.   

    是的,b.cont_id=a.cont_id的结果集很大,但是前面有限制条件:a.cont_id=12
    另外如果语句1换成以下:
    select * from t_acct a,t_acct_item b
    where a.cont_id=12 and b.cont_id=a.cont_id;
    查询速度会很快
    t_acct_item是一个表,视图v_huafei_item是建立在t_acct_item表之上的
    请问高手是视图会造成什么影响吗?谢谢
      

  4.   

    用autotrace看看这两个语句的执行顺序就知道了
      

  5.   

    1.select * from t_acct a,v_huafei_item b
    where a.cont_id=12 and b.cont_id=a.cont_id;---->
    it should be faster if you do 
    1.select * from t_acct a,v_huafei_item b
    where  b.cont_id=a.cont_id and a.cont_id=12 
      

  6.   

    你的表的cont_id有没有索引。
    还有就是表的记录和试图的纪录数哪一个多,以及两个记录数的数量级,是几百,还是几十万,几百万看看两个sql语句的执行计划,优化器是rbo,还是cbo 加上hint  rule 看看
    good luck