动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
电脑书籍下载:程序设计书籍 | 数据库教程书籍 | 平面与多媒体书籍 | 网络通讯书籍 | 系统管理书籍 | 网络安全书籍 | 认证考试书籍
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库 > Oracle教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Sybase教程,Access教程,DB2教程,数据库安全,数据库文摘
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ Oracle教程 ]的信息



本月文章推荐
.为什么ODBC不是Linux的一个标准特.
.在Linux下安装VNC 远程安装Oracle.
.[Oracle]探讨数据库的数据导入方.
.在Oracle数据库上构建.NET应用程.
.利用Java存储过程简化数据库操作.
.Oracle FAQ 之备份与恢复篇.
.Oracle备份与恢复案例二.
.新手学习之Oracle trunc()函数的.
.一条有用的sql文(ORACLE).
.Oracle SQL依然无可替代-Masteri.
.解析:在Oracle中导入额外的字段.
.Oracle网格计算中文资料—网格计.
.PL/SQL学习笔记(五).
.Oracle备份与恢复案例一.
.如何察看系统cpu,内存等利用情况.
.为什么当系统启动到Sendmail时会.
.PL/SQL学习笔记(二).
.系统设定常用指令(1).
.ORACLE在HP-UX下的系列问题处理(.
.如何在oracle存储过程中返回游标.

sqlplus的oci prefetch特性

发表日期:2008-2-9 |


Hi TOM,
  I traced some sqls with " full table scan ",and it always returns 1 row (r=1)
during first fetch .
  Is this because of "cursor prefetch" or else? Hope your advice. For example,full table scan dual
=====================
PARSING IN CURSOR #1 len=18 dep=0 uid=62 oct=3 lid=62 tim=106633135131
hv=4035109885 ad='65fc41d8'
select * from dual
END OF STMT
PARSE #1:c=0,e=5796,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=4,tim=106633135123
EXEC #1:c=0,e=44,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=106633140740
WAIT #1: nam='SQL*Net message to client' ela= 6 p1=1111838976 p2=1 p3=0
FETCH #1:c=0,e=108,p=0,cr=3,cu=0,mis=0,r=1,dep=0,og=4,tim=106633143298
WAIT #1: nam='SQL*Net message from client' ela= 8755 p1=1111838976 p2=1 p3=0
FETCH #1:c=0,e=3,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=0,tim=106633154841
WAIT #1: nam='SQL*Net message to client' ela= 5 p1=1111838976 p2=1 p3=0
WAIT #1: nam='SQL*Net message from client' ela= 8055707 p1=1111838976 p2=1 p3=0
===================== For example,full table scan table T
=====================
PARSING IN CURSOR #1 len=31 dep=0 uid=62 oct=3 lid=62 tim=106641556744
hv=1251189969 ad='65fb71a8'
select * from t where rownum<25
END OF STMT
PARSE #1:c=78125,e=304217,p=13,cr=76,cu=0,mis=1,r=0,dep=0,og=4,tim=106641556737
EXEC #1:c=0,e=32,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=4,tim=106641556863
WAIT #1: nam='SQL*Net message to client' ela= 4 p1=1111838976 p2=1 p3=0
WAIT #1: nam='db file sequential read' ela= 20586 p1=9 p2=15459 p3=1
WAIT #1: nam='db file scattered read' ela= 675 p1=9 p2=15460 p3=5
FETCH #1:c=0,e=21702,p=6,cr=7,cu=0,mis=0,r=1,dep=0,og=4,tim=106641578624
WAIT #1: nam='SQL*Net message from client' ela= 463 p1=1111838976 p2=1 p3=0
WAIT #1: nam='SQL*Net message to client' ela= 2 p1=1111838976 p2=1 p3=0
FETCH #1:c=0,e=71,p=0,cr=1,cu=0,mis=0,r=15,dep=0,og=4,tim=106641579287
WAIT #1: nam='SQL*Net message from client' ela= 358220 p1=1111838976 p2=1 p3=0
WAIT #1: nam='SQL*Net message to client' ela= 3 p1=1111838976 p2=1 p3=0
FETCH #1:c=0,e=102,p=0,cr=1,cu=0,mis=0,r=8,dep=0,og=4,tim=106641937758
WAIT #1: nam='SQL*Net message from client' ela= 4991127 p1=1111838976 p2=1 p3=0
STAT #1 id=1 cnt=24 pid=0 pos=1 obj=0 op='COUNT STOPKEY '
===================== Thanks in advance.
Steven looks like a sqlplus "ism" (http://en.wikipedia.org/wiki/-ism ) drop table t;
create table t as select * from all_users;
alter session set events '10046 trace name context forever, level 12';
select username from t where rownum <25; declare
    type array is table of varchar2(30) index by binary_integer;
    l_array array;
begin
    select username bulk collect into l_array from t where rownum<25;
end;
/
it is the client doing it -- sqlplus purposely did this for some reason. =====================
PARSING IN CURSOR #5 len=39 dep=0 uid=93 oct=3 lid=93 tim=1089161938125904
hv=1020576043 ad='89965438'
select username from t where rownum <25
END OF STMT
PARSE #5:c=0,e=5127,p=5,cr=10,cu=0,mis=1,r=0,dep=0,og=1,tim=1089161938125896
BINDS #5:
EXEC #5:c=0,e=71,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,tim=1089161938126125
WAIT #5: nam='SQL*Net message to client' ela= 3 p1=1650815232 p2=1 p3=0 FETCH #5:c=0,e=75,p=0,cr=3,cu=0,mis=0,r=1,dep=0,og=1,tim=1089161938126290 WAIT #5: nam='SQL*Net message from client' ela= 220 p1=1650815232 p2=1 p3=0
WAIT #5: nam='SQL*Net message to client' ela= 3 p1=1650815232 p2=1 p3=0
FETCH #5:c=0,e=76,p=0,cr=1,cu=0,mis=0,r=15,dep=0,og=1,tim=1089161938126727
WAIT #5: nam='SQL*Net message from client' ela= 56435 p1=1650815232 p2=1 p3=0
WAIT #5: nam='SQL*Net message to client' ela= 2 p1=1650815232 p2=1 p3=0
FETCH #5:c=0,e=83,p=0,cr=1,cu=0,mis=0,r=8,dep=0,og=1,tim=1089161938183401
WAIT #5: nam='SQL*Net message from client' ela= 73860 p1=1650815232 p2=1 p3=0
=====================
PARSING IN CURSOR #1 len=38 dep=1 uid=93 oct=3 lid=93 tim=1089161938268277
hv=1337640224 ad='8992bb44'
SELECT USERNAME FROM T WHERE ROWNUM<25
END OF STMT
PARSE #1:c=0,e=2415,p=0,cr=8,cu=0,mis=1,r=0,dep=1,og=1,tim=1089161938268270
BINDS #1:
EXEC #1:c=0,e=74,p=0,cr=0,cu=0,mis=0,r=0,dep=1,og=1,tim=1089161938268502 FETCH #1:c=0,e=113,p=0,cr=3,cu=0,mis=0,r=24,dep=1,og=1,tim=1089161938268650 EXEC #9:c=0,e=3015,p=0,cr=11,cu=0,mis=0,r=1,dep=0,og=1,tim=1089161938268746
WAIT #9: nam='SQL*Net message to client' ela= 3 p1=1650815232 p2=1 p3=0
WAIT #9: nam='SQL*Net message from client' ela= 163 p1=1650815232 p2=1 p3=0
===================== SQLPLUS is using OCI8  May 06, 2005
Reviewer:  Anjo Kolk  from Garderen, The Netherlands SQLPlus is using OCI8 (Oracle Call Interface) into the kernel since Oracle8.
OCI8 has this prefetch feature, so if you would rewrite this example in OCI8, it
should show the same behaviour. Followup:
Anjo, thanks! http://asktom.oracle.com/pls/ask/f?p=4950:8:3341804672157758663::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:880343948514,
Array size by default is 15 in plus
10 in JDBC
2 in pro*c
1 in OCI
??? in odbc (no idea, never use it)
...
(sqlplus is JUST an oci application)
...
If you full scan a table T that has N blocks and R rows and you use an array
fetch size of A, we will typically perform the following number of consistent
gets: N + R/A
...
A FACTOR in consistent gets is arraysize. ARRAYSIZE does not determine consistent gets. right">(出处:清风软件下载学院)
上一篇:同条SQL,有时buffer get会暴增 人气:366
下一篇:不重建快照的情况下可以修改主表 (二) 人气:389
浏览全部Oracle教程的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-7-24 Sablog-X v2.0 预览版
2008-7-24 帝国备份王EmpireBak 2008 正式版
2008-7-24 网趣网上购物系统时尚版 v8.2
2008-7-24 纵横B2B电子商务系统XYECS!B2B v
2008-7-24 e路小说小偷 v1.2.0723
2008-7-24 凌风美女图片站程序 v2.2
2008-7-24 TOM15电影收索程序
2008-7-24 清风信息自动采集生成系统 v1.0
2008-7-24 QQ邮箱编辑器 v1.0 (小小菜刀ASP
2008-7-19 UltraEdit 简体中文增强版 14.10
2008-7-19 CentOS 5.2 i386 LiveCD
2008-7-19 Snapture多功能相机 v1.4
2008-7-19 iAcces中文输入法 v1.0Build016
2008-7-19 Cookbook烹饪秘籍 v2.5
2008-7-19 苹果专用DVD转换工具 v1.1.59汉化
2008-7-19 Modem修复软件ZiPhone修改版04.0
2008-7-19 AgileMessenger即时通讯工具美化
2008-7-19 Sketches画图软件 v0.7b6破解版


  发表评论
姓 名: 验证码:
内 容:
[ 汉字翻译拼音 ] [ 广告代码 ] [ 符号对照表 ] [ 进制转换 ] [ 经典小工具 ] [ 个税计算 ] [ 汉字简繁转换 ] [ 普通单位换算 ] [ 公制单位换算 ]
[ 生辰老黄历 ] [ 国内电话区号 ] [ 国家代码与域名缩写 ] [ 文字加密解密 ] [ 健康查询 ] [ 万年历 ] [ 手机号码查询 ] [ ip搜索 ] [ Google PR查询 ]
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号