=====================
PARSING IN CURSOR #1 len=362 dep=0 uid=11 oct=3 lid=11 tim=0 hv=1165040034 ad='8
6f94de4'  SELECT  "BJ"."NUM" ,           "BJ"."YJHM" ,           "BJ"."TD_DATE1" ,
     "BJ"."TDQK" ,           "BJ"."NAME"     FROM "BJ"      WHERE (ltrim(rtrim(B
J.TD_DD)) = :td_val ) and          (ltrim(rtrim(BJ.TDJM)) = :tdjm_val ) and
     ( BJ.TDPCS = :pc_val ) and          (substr(td_mach,length(td_mach),1) = :b
z_val)  ORDER BY "BJ"."NUM"          ASC
END OF STMT
PARSE #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=0
EXEC #1:c=0,e=0,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=0
FETCH #1:c=0,e=0,p=0,cr=115,cu=2,mis=0,r=238,dep=0,og=4,tim=0
Thu Nov 27 14:48:25 2003
STAT #6 id=1 cnt=0
STAT #6 id=2 cnt=1
STAT #7 id=1 cnt=0
STAT #7 id=2 cnt=1
STAT #8 id=1 cnt=0
STAT #8 id=2 cnt=1
STAT #10 id=1 cnt=0
STAT #10 id=2 cnt=1
STAT #11 id=1 cnt=0
STAT #11 id=2 cnt=1
STAT #12 id=1 cnt=0
STAT #12 id=2 cnt=1
STAT #13 id=1 cnt=0
STAT #13 id=2 cnt=28
STAT #13 id=3 cnt=0
STAT #14 id=1 cnt=28
STAT #15 id=1 cnt=28
STAT #16 id=1 cnt=0
STAT #16 id=2 cnt=28
STAT #4 id=1 cnt=1
STAT #4 id=2 cnt=1
STAT #5 id=1 cnt=6
STAT #5 id=2 cnt=7
STAT #1 id=1 cnt=238
STAT #1 id=2 cnt=1800

解决方案 »

  1.   


     把下面的代码做一个查询计划,看看效率:  SELECT "BJ"."NUM","BJ"."YJHM", "BJ"."TD_DATE1","BJ"."TDQK",
     "BJ"."NAME"  FROM "BJ" 
        WHERE (ltrim(rtrim(BJ.TD_DD)) = :td_val ) 
        and  (ltrim(rtrim(BJ.TDJM)) = :tdjm_val ) 
        and
         ( BJ.TDPCS = :pc_val ) and
         (substr(td_mach,length(td_mach),1) = :bz_val) 
        ORDER BY "BJ"."NUM"   ASC  感觉: 查询列上运用了大量的字符串操作函数,效率会比较低.
      

  2.   

    字符串操作会降低efficiency吗?,这张表不大,但非常频繁的update,delete,insert
      

  3.   

    怎样做查询计。我用TOAD的工具,但提示ORA-02404: 没找到指定的计划表。我该怎么办?
      

  4.   


     1. 运行下面的脚本: 把下面的USERNAME 替换成实际的用户    set echo on
        drop role plustrace;
        create role plustrace;    grant select on v_$sesstat to plustrace;
        grant select on v_$statname to plustrace;
        grant select on v_$session to plustrace;
        grant plustrace to UserName with admin option;
                           --------  
        
        set echo off
        
      2. 运行 %ORACLE_HOME%\RDBMS\ADMIN\utlxplan.sql ,
        创建PlanTable表.
      
      3. 进入sqlplus:
         SQL>set autotrace on    4. 如果需要准确的运行时间信息,修改 init<SID>.ora,
         timed_statistics = true 
         
         重新启动后,进入sqlplus: set timing on   BTW: 上面对SQLPLUS一些配置的改动 都可以写在
            %ORACLE_HOME%\SQLPLUS\ADMIN\glogin.sql 中.