sorry,改成select * 的话是30秒,如果是select count(*) 的话,就好好几分钟了

解决方案 »

  1.   

    select count(1) 
      from ( select * from icd.tbilllog8 
        where callidnum = '-1'
                and callbegin between trunc(to_date('2006-08-30','yyyy-mm-dd')) 
    and trunc(to_date('2006-08-31','yyyy-mm-dd'))) A, 
           (select called_area_code from knowledge_ywipcode 
                  where area_name like '%铁通%') B
     where substr(A.callerno, 5, 3) = B.called_area_code
        or substr(A.callerno, 13, 3) = B.called_area_code
      

  2.   

    1)用in效率低
    2)like语句用了两次,增加了查询复杂度,影响效率