关于Bind Variables Peeking

来源:互联网 发布:mac ai如何剪切图片 编辑:程序博客网 时间:2024/04/30 06:36

关于Bind Variables Peeking,文档上有一段话,说的也不是很清楚。
The following query uses a bind variable rather than a literal value for the boundary value in the WHERE clause condition:

SELECT *
FROM employees
WHERE employee_id < :e1;


The optimizer does not know the value of the bind variable e1. The value of e1 might be different each time the query is executed. For this reason, the optimizer cannot use the means described in the previous example to determine selectivity of this query. In this case, the optimizer heuristically guesses a small value for the selectivity, using an internal default value. The optimizer makes this assumption whenever a bind variable is used as a boundary value in a condition with one of the following operators: <, >, <=, or >=.

The optimizer's treatment of bind variables can cause it to choose different execution plans for SQL statements that differ only in the use of bind variables rather than constants. For example, the optimizer might choose different execution plans for an embedded SQL statement with a bind variable in an Oracle precompiler program and the same SQL statement with a constant in SQL*Plus.

从Oracle9i开始Oracle提供了Bind Variables Peeking,在使用绑定变量的SQL第一次执行时,使用参数传递成文本sql,此时可以利用存在的柱状图信息产生执行计划,从而在数据分布不均的情况下,可能可以产生更为精确的执行计划.
在使用set auotrace,explain plan查看绑定变量的sql语句的执行计划有可能不准确。因为set autotrace,explain plan等操作并不会发生Bind Variables Peeking,它并不会把绑定变量的值反映到执行计划里面,不会去看柱状图的数据分布,所以它生成的计划并不可信。实际的执行计划可以在sql_trace中看到。
下面是我的测试:
create table peeking as Select 1 Id, a.* From Dba_Objects a

Insert Into peeking Select * From peeking
commit

Select Count(1) From peeking
24972
update peeking set id = 99 where rownum <2
commit

create index peeking_ind on peeking(id)

analyze table peeking compute statistics for table for all indexed Columns

--下面是使用autotrace查看执行计划

C:Documents and SettingsAdministrator>sqlplus /nolog

SQL*Plus: Release 9.2.0.6.0 - Production on Wed Nov 29 13:38:00 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> conn test/test
Connected.
SQL> var v number
SQL> exec :v:=99

PL/SQL procedure successfully completed.

SQL> set autotrace traceonly explain;
SQL> select * from peeking where id = :v;

Execution Plan
----------------------------------------------------------
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=38 Card=12486 Bytes=1111254)
1 0 TABLE ACCESS (FULL) OF 'PEEKING' (Cost=38 Card=12486 Bytes=1111254)

--下面是使用explain plan查看执行计划

C:Documents and SettingsAdministrator>sqlplus /nolog

SQL*Plus: Release 9.2.0.6.0 - Production on Wed Nov 29 13:44:09 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> conn test/test
Connected.
SQL> var v number
SQL> exec :v:=99

PL/SQL procedure successfully completed.

SQL> explain plan for select * from peeking where id = :v;

Explained.

SQL> select * from table(dbms_xplan.display);

PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------


--------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 12486 | 1085K| 38 |
|* 1 | TABLE ACCESS FULL | PEEKING | 12486 | 1085K| 38 |
--------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------


PLAN_TABLE_OUTPUT
--------------------------------------------------------------------------------

1 - filter("PEEKING"."ID"=TO_NUMBER(:Z))

Note: cpu costing is off

14 rows selected.

都是使用TABLE ACCESS FULL,可见这两个方法看到的执行计划都应该不是正确的。
下面是使用sql_trace看到实际执行时的执行计划

C:Documents and SettingsAdministrator>sqlplus /nolog

SQL*Plus: Release 9.2.0.6.0 - Production on Wed Nov 29 13:49:14 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> conn test/test
Connected.
SQL> var v number
SQL> exec :v:=99

PL/SQL procedure successfully completed.

SQL> alter session set sql_trace = true;

Session altered.

SQL> select * from peeking where id = :v;

ID OWNER
---------- ------------------------------
OBJECT_NAME
--------------------------------------------------------------------------------

SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
------------------------------ ---------- -------------- ------------------
CREATED LAST_DDL_ TIMESTAMP STATUS T G S
--------- --------- ------------------- ------- - - -
99 SYS
ACCESS$
97 97 TABLE
24-OCT-06 24-OCT-06 2006-10-24:22:06:41 VALID N N N


SQL> alter session set sql_trace = false;

Session altered.

--TKPROF产生的trace file后可以得到真正的执行计划
********************************************************************************

select *
from
peeking where id = :v


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.01 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.15 1 3 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 0.01 0.15 1 3 0 1

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 24

Rows Row Source Operation
------- ---------------------------------------------------
1 TABLE ACCESS BY INDEX ROWID PEEKING
1 INDEX RANGE SCAN PEEKING_IND (object id 6429)

********************************************************************************
使用了Index,这个执行计划是最优的也是正确的。

但是Bind Variables Peeking还有些不足。对于一个绑定变量的sql,在第一次执行时会产生Bind Variables Peeking,产生正确的执行计划,但如果变量的值在下次执行时改变,还会使用原来产生的执行计划,而这个变量的列数据如果分布比较不匀,这样实际上原来的执行计划已经不是最佳的,就会有性能问题。
下面是测试:
先重启数据库。

C:Documents and SettingsAdministrator>sqlplus /nolog

SQL*Plus: Release 9.2.0.6.0 - Production on Wed Nov 29 13:49:14 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> conn test/test
Connected.
SQL> var v number
SQL> exec :v:=99

PL/SQL procedure successfully completed.

SQL> alter session set sql_trace = true;

Session altered.

SQL> select * from peeking where id = :v;

ID OWNER
---------- ------------------------------
OBJECT_NAME
--------------------------------------------------------------------------------

SUBOBJECT_NAME OBJECT_ID DATA_OBJECT_ID OBJECT_TYPE
------------------------------ ---------- -------------- ------------------
CREATED LAST_DDL_ TIMESTAMP STATUS T G S
--------- --------- ------------------- ------- - - -
99 SYS
ACCESS$
97 97 TABLE
24-OCT-06 24-OCT-06 2006-10-24:22:06:41 VALID N N N


SQL> alter session set sql_trace = false;

Session altered.

--TKPROF格式化trace file的结果,发生Bind Variables Peeking:

TKPROF: Release 9.2.0.6.0 - Production on Wed Nov 29 14:10:20 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Trace file: D:oracleadminzhangyeudumpzhangye_ora_2912.trc
Sort options: default

********************************************************************************
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
********************************************************************************

alter session set sql_trace = true


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 0 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 1 0.00 0.00 0 0 0 0

Misses in library cache during parse: 0
Misses in library cache during execute: 1
Optimizer goal: CHOOSE
Parsing user id: 24
********************************************************************************

select obj#,type#,ctime,mtime,stime,status,dataobj#,flags,oid$, spare1,
spare2
from
obj$ where owner#=:1 and name=:2 and namespace=:3 and remoteowner is null
and linkname is null and subname is null


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.01 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 3 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.01 0.00 0 3 0 1

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select ts#,file#,block#,nvl(bobj#,0),nvl(tab#,0),intcols,nvl(clucols,0),
audit$,flags,pctfree$,pctused$,initrans,maxtrans,rowcnt,blkcnt,empcnt,
avgspc,chncnt,avgrln,analyzetime, samplesize,cols,property,nvl(degree,1),
nvl(instances,1),avgspc_flb,flbcnt,kernelcols,nvl(trigflag, 0),nvl(spare1,0)
,nvl(spare2,0),spare4,spare6
from
tab$ where obj#=:1


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 3 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 3 0 1

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select i.obj#,i.ts#,i.file#,i.block#,i.intcols,i.type#,i.flags, i.property,
i.pctfree$,i.initrans,i.maxtrans,i.blevel,i.leafcnt,i.distkey, i.lblkkey,
i.dblkkey,i.clufac,i.cols,i.analyzetime,i.samplesize,i.dataobj#,
nvl(i.degree,1),nvl(i.instances,1),i.rowcnt,mod(i.pctthres$,256),
i.indmethod#,i.trunccnt,nvl(c.unicols,0),nvl(c.deferrable#+c.valid#,0),
nvl(i.spare1,i.intcols),i.spare4,spare2,spare6, decode(i.pctthres$,null,
null, mod(trunc(i.pctthres$/256),256))
from
ind$ i, (select enabled, min(cols) unicols, min(to_number(bitand(defer,1)))
deferrable#, min(to_number(bitand(defer,4))) valid# from cdef$ where obj#=
:1 and enabled > 1 group by enabled) c where i.obj#=c.enabled(+) and i.bo#=
:1


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.00 0 4 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 0.00 0.00 0 4 0 1

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select pos#,intcol#,col#,spare1,bo#,spare2
from
icol$ where obj#=:1


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.01 1 3 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 0.00 0.01 1 3 0 1

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select name,intcol#,segcol#,type#,length,nvl(precision#,0),decode(type#,2,
nvl(scale,-127/*MAXSB1MINAL*/),178,scale,179,scale,180,scale,181,scale,182,
scale,183,scale,231,scale,0),null$,fixedstorage,nvl(deflength,0),default$,
rowid,col#,property, nvl(charsetid,0),nvl(charsetform,0),spare1,spare2,
nvl(spare3,0)
from
col$ where obj#=:1 order by intcol#


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 15 0.00 0.00 0 3 0 14
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 17 0.00 0.00 0 3 0 14

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select type#,blocks,extents,minexts,maxexts,extsize,extpct,user#,iniexts,
NVL(lists,65535),NVL(groups,65535),cachehint,hwmincr, NVL(spare1,0)
from
seg$ where ts#=:1 and file#=:2 and block#=:3


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 2 0.01 0.00 0 0 0 0
Execute 2 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.00 0 6 0 2
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 6 0.01 0.00 0 6 0 2

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)

Rows Row Source Operation
------- ---------------------------------------------------
1 TABLE ACCESS CLUSTER SEG$
1 INDEX UNIQUE SCAN I_FILE#_BLOCK# (object id 9)

********************************************************************************

select con#,obj#,rcon#,enabled,nvl(defer,0)
from
cdef$ where robj#=:1


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 1 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 1 0 0

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select con#,type#,condlength,intcols,robj#,rcon#,match#,refact,nvl(enabled,0),
rowid,cols,nvl(defer,0),mtime,nvl(spare1,0)
from
cdef$ where obj#=:1


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 1 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 1 0 0

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select col#, grantee#, privilege#,max(mod(nvl(option$,0),2))
from
objauth$ where obj#=:1 and col# is not null group by privilege#, col#,
grantee# order by col#, grantee#


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 2 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 2 0 0

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select grantee#,privilege#,nvl(col#,0),max(mod(nvl(option$,0),2))
from
objauth$ where obj#=:1 group by grantee#,privilege#,nvl(col#,0) order by
grantee#


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.00 0 2 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.00 0 2 0 0

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select *
from
peeking where id = :v


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.06 0.87 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.09 3 3 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 0.06 0.97 3 3 0 1

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 24

Rows Row Source Operation
------- ---------------------------------------------------
1 TABLE ACCESS BY INDEX ROWID PEEKING
1 INDEX RANGE SCAN PEEKING_IND (object id 6429)

********************************************************************************

select /*+ rule */ bucket_cnt, row_cnt, cache_cnt, null_cnt, timestamp#,
sample_size, minimum, maximum, distcnt, lowval, hival, density, col#,
spare1, spare2, avgcln
from
hist_head$ where obj#=:1 and intcol#=:2


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 14 0.00 0.00 0 0 0 0
Fetch 14 0.00 0.01 1 15 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 29 0.00 0.01 1 15 0 1

Misses in library cache during parse: 1
Optimizer goal: RULE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select /*+ rule */ bucket, endpoint, col#, epvalue
from
histgrm$ where obj#=:1 and intcol#=:2 and row#=:3 order by bucket


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1 0.00 0.02 2 2 0 2
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 3 0.00 0.02 2 2 0 2

Misses in library cache during parse: 1
Optimizer goal: RULE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

select o.owner#,o.name,o.namespace,o.remoteowner,o.linkname,o.subname,
o.dataobj#,o.flags
from
obj$ o where o.obj#=:1


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 2 0.00 0.00 0 0 0 0
Execute 2 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.00 0 6 0 2
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 6 0.00 0.00 0 6 0 2

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: SYS (recursive depth: 1)
********************************************************************************

alter session set sql_trace = false


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 0.00 0.00 0 0 0 0

Misses in library cache during parse: 1
Optimizer goal: CHOOSE
Parsing user id: 24

 

********************************************************************************

OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 2 0.06 0.87 0 0 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 2 0.00 0.09 3 3 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 7 0.06 0.97 3 3 0 1

Misses in library cache during parse: 2
Misses in library cache during execute: 1


OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 15 0.03 0.03 0 0 0 0
Execute 28 0.00 0.00 0 0 0 0
Fetch 44 0.00 0.05 4 51 0 25
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 87 0.03 0.09 4 51 0 25

Misses in library cache during parse: 13

3 user SQL statements in session.
15 internal SQL statements in session.
18 SQL statements in session.
********************************************************************************
Trace file: D:oracleadminzhangyeudumpzhangye_ora_2912.trc
Trace file compatibility: 9.02.00
Sort options: default

1 session in tracefile.
3 user SQL statements in trace file.
15 internal SQL statements in trace file.
18 SQL statements in trace file.
16 unique SQL statements in trace file.
195 lines in trace file.

--改变变量的值后执行同样的sql.

SQL> var v number
SQL> exec :v:=1

PL/SQL procedure successfully completed.

SQL> alter session set sql_trace = true;

Session altered.

SQL> select * from peeking where id = :v;

SQL> alter session set sql_trace = false;

Session altered.

--TKPROF格式化trace file的结果,发现没有发生Bind Variables Peeking,直接使用上次产生的执行计划,使用了index,可见执行计划不是最优的:
TKPROF: Release 9.2.0.6.0 - Production on Wed Nov 29 14:19:50 2006

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

Trace file: D:oracleadminzhangyeudumpzhangye_ora_3156.trc
Sort options: default

********************************************************************************
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
********************************************************************************

alter session set sql_trace = true


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 0 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 1 0.00 0.00 0 0 0 0

Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 24
********************************************************************************

select *
from
peeking where id = :v


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 1666 0.18 0.15 0 3679 0 24971
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 1668 0.18 0.15 0 3679 0 24971

Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 24

Rows Row Source Operation
------- ---------------------------------------------------
24971 TABLE ACCESS BY INDEX ROWID PEEKING
24971 INDEX RANGE SCAN PEEKING_IND (object id 6429)

********************************************************************************

alter session set sql_trace = false


call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 2 0.00 0.00 0 0 0 0

Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 24

 

********************************************************************************

OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 2 0.00 0.00 0 0 0 0
Execute 3 0.00 0.00 0 0 0 0
Fetch 1666 0.18 0.15 0 3679 0 24971
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 1671 0.18 0.15 0 3679 0 24971

Misses in library cache during parse: 0


OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 0 0.00 0.00 0 0 0 0
Execute 0 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 0 0.00 0.00 0 0 0 0

Misses in library cache during parse: 0

3 user SQL statements in session.
0 internal SQL statements in session.
3 SQL statements in session.
********************************************************************************
Trace file: D:oracleadminzhangyeudumpzhangye_ora_3156.trc
Trace file compatibility: 9.02.00
Sort options: default

1 session in tracefile.
3 user SQL statements in trace file.
0 internal SQL statements in trace file.
3 SQL statements in trace file.
3 unique SQL statements in trace file.
1707 lines in trace file.

 
原创粉丝点击