我在sqlplus中执行一条sql语句,语句中进行了一些子查询,大概响应时间需要6秒,但是我发现如果有4次同样的操做同时并发,这个时候数据库的响应时间就成了30多秒,所以我的程序响应的就非常慢了。请问问题在哪里了(我只是默认安装了oracle,没有进行数据库的优化调整,请问这个问题是应该优化oracle哪里的配置)

解决方案 »

  1.   

    你SQL语句中使用了子查询吗?如果有,改为关联查询。
    将你的SQL贴出来看看?
      

  2.   

    select count(*) from flow_inst A,step_inst B,step_inst B2,deal_info C,base_user D,tree_def T where A.flow_inid=C.flow_inid  and B.step_inco=C.step_inco 
    and C.peri_man=D.user_code(+) and A.curr_step=B2.step_inco and T.item_seq=A.flow_id
    and (C.step_inco ||' '|| to_char(C.deal_indx)) in 
    ( select max(CC.step_inco ||' '|| to_char(CC.deal_indx) )  from flow_inst AA,deal_info CC,base_user DD,base_user DD2,tree_def TT 
    where AA.flow_inid=CC.flow_inid and CC.peri_man=DD.user_code(+) and AA.inst_crea=DD2.user_code(+) and AA.flow_id=TT.item_seq 
    and (AA.del_flag is null or AA.del_flag=0) and CC.fini_flag is not null and CC.step_type<>5 and (1=1) group by AA.flow_inid )  
    order by B.crea_date desc这个就是sql
      

  3.   

    http://tech.sina.com.cn/c/2002-02-25/11339.html
      

  4.   

    写错了,用工具软件sql expert for oracle优化一下sql