【Oracle】arraysize的研究(存在疑问)
arraysize的研究(存在疑问)
SYS@proc> create table aaa (id1 int,id2 int,id3 int,id4 int);
Table created.
SYS@proc> create table aaa1 (id1 int,id2 int,id3 int,id4 int);
Table created.
SYS@proc> insert into aaa values (1,1,1,1);
1 row created.
SYS@proc> insert into aaa values (1,1,1,0);
1 row created.
SYS@proc> commit;
Commit complete.
SYS@proc> insert into aaa1 values (1,1,1,0);
1 row created.
SYS@proc> insert into aaa1 values (1,1,1,1);
1 row created.
SYS@proc> commit;
Commit complete.
SYS@proc> select * from aaa;
ID1 ID2 ID3 ID4
---------- ---------- ---------- ----------
1 1 1 1
1 1 1 0
SYS@proc> select * from aaa1;
ID1 ID2 ID3 ID4
---------- ---------- ---------- ----------
1 1 1 0
1 1 1 1
SYS@proc> select * from aaa where id1/id2=1 and id3/id4=1;
ERROR:
ORA-01476: divisor is equal to zero
no rows selected
SYS@proc> set arraysize 1
SYS@proc> /
ID1 ID2 ID3 ID4
---------- ---------- ---------- ----------
1 1 1 1
ERROR:
ORA-01476: divisor is equal to zero
SYS@proc> select * from aaa1 where id1/id2=1 and id3/id4=1;
select * from aaa1 where id1/id2=1 and id3/id4=1
*
ERROR at line 1:
ORA-01476: divisor is equal to zero
SYS@proc> create table aaa2 (id1 int,id2 int,id3 int,id4 int,flag int);
Table created.
SYS@proc> insert into aaa2 values(1,1,1,1,1);
1 row created.
SYS@proc> insert into aaa2 values(1,1,1,1,2);
1 row created.
SYS@proc> insert into aaa2 values(1,1,1,1,3);
1 row created.
SYS@proc> insert into aaa2 values(1,1,1,1,4);
1 row created.
SYS@proc> insert into aaa2 values(1,1,1,1,5);
1 row created.
SYS@proc> insert into aaa2 values(1,1,1,1,6);
1 row created.
SYS@proc> insert into aaa2 values(1,1,1,1,7);
1 row created.
SYS@proc> insert into aaa2 values(1,1,1,1,8);
1 row created.
SYS@proc> insert into aaa2 values(1,1,1,1,9);
1 row created.
SYS@proc> insert into aaa2 values(1,1,1,1,10);
1 row created.
SYS@proc> insert into aaa2 values(1,1,1,0,0);
1 row created.
SYS@proc> commit;
Commit complete.
SYS@proc> analyze table aaa2 compute statistics;
Table analyzed.
SYS@proc> set arraysize 1
SYS@proc> select * from aaa2 where id1/id2=1 and id3/id4=1;
ID1 ID2 ID3 ID4 FLAG
---------- ---------- ---------- ---------- ----------
1 1 1 1 1
1 1 1 1 2
1 1 1 1 3
1 1 1 1 4
1 1 1 1 5
1 1 1 1 6
1 1 1 1 7
1 1 1 1 8
1 1 1 1 9
ERROR:
ORA-01476: divisor is equal to zero
9 rows selected.
–从大量结果上看,arraysize为1或者2是一样的。这里为9预见。
SYS@proc> select * from aaa2;
ID1 ID2 ID3 ID4 FLAG
---------- ---------- ---------- ---------- ----------
1 1 1 1 1
1 1 1 1 2
1 1 1 1 3
1 1 1 1 4
1 1 1 1 5
1 1 1 1 6
1 1 1 1 7
1 1 1 1 8
1 1 1 1 9
1 1 1 1 10
1 1 1 0 0
11 rows selected.
SYS@proc> set arraysize 2
SYS@proc> select * from aaa2 where id1/id2=1 and id3/id4=1;
ID1 ID2 ID3 ID4 FLAG
---------- ---------- ---------- ---------- ----------
1 1 1 1 1
1 1 1 1 2
1 1 1 1 3
1 1 1 1 4
1 1 1 1 5
1 1 1 1 6
1 1 1 1 7
1 1 1 1 8
ERROR:
ORA-01476: divisor is equal to zero
8 rows selected.
语句对应的10046,可以看出是返回了9行,但是从上边看是8行,很奇怪。
PARSING IN CURSOR #140496887317072 len=48 dep=0 uid=0 oct=3 lid=0 tim=1514130832420098 hv=3007681721 ad='812bd000' sqlid='7cfwyuytnb55t'
select * from aaa2 where id1/id2=1 and id3/id4=1
END OF STMT
PARSE #140496887317072:c=0,e=1221,p=0,cr=0,cu=0,mis=1,r=0,dep=0,og=1,plh=2576342259,tim=1514130832420093
EXEC #140496887317072:c=0,e=24,p=0,cr=0,cu=0,mis=0,r=0,dep=0,og=1,plh=2576342259,tim=1514130832420198
WAIT #140496887317072: nam='SQL*Net message to client' ela= 5 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832420238
FETCH #140496887317072:c=0,e=64,p=0,cr=2,cu=0,mis=0,r=1,dep=0,og=1,plh=2576342259,tim=1514130832420331
WAIT #140496887317072: nam='SQL*Net message from client' ela= 476 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832420842
WAIT #140496887317072: nam='SQL*Net message to client' ela= 3 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832420907
FETCH #140496887317072:c=0,e=36,p=0,cr=1,cu=0,mis=0,r=2,dep=0,og=1,plh=2576342259,tim=1514130832420924
WAIT #140496887317072: nam='SQL*Net message from client' ela= 146 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832421092
WAIT #140496887317072: nam='SQL*Net message to client' ela= 2 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832421137
FETCH #140496887317072:c=0,e=28,p=0,cr=1,cu=0,mis=0,r=2,dep=0,og=1,plh=2576342259,tim=1514130832421151
WAIT #140496887317072: nam='SQL*Net message from client' ela= 66 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832421237
WAIT #140496887317072: nam='SQL*Net message to client' ela= 2 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832421277
FETCH #140496887317072:c=0,e=26,p=0,cr=1,cu=0,mis=0,r=2,dep=0,og=1,plh=2576342259,tim=1514130832421290
WAIT #140496887317072: nam='SQL*Net message from client' ela= 60 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832421369
WAIT #140496887317072: nam='SQL*Net message to client' ela= 1 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832421407
FETCH #140496887317072:c=0,e=25,p=0,cr=1,cu=0,mis=0,r=2,dep=0,og=1,plh=2576342259,tim=1514130832421420
WAIT #140496887317072: nam='SQL*Net message from client' ela= 410 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832421848
WAIT #140496887317072: nam='SQL*Net message to client' ela= 2 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832421907
FETCH #140496887317072:c=0,e=63,p=0,cr=1,cu=0,mis=0,r=1,dep=0,og=1,plh=2576342259,tim=1514130832421956
STAT #140496887317072 id=1 cnt=10 pid=0 pos=1 obj=88977 op='TABLE ACCESS FULL AAA2 (cr=7 pr=0 pw=0 time=94 us cost=2 size=10 card=1)'
WAIT #140496887317072: nam='SQL*Net break/reset to client' ela= 28 driver id=1650815232 break?=1 p3=0 obj#=-1 tim=1514130832422110
WAIT #140496887317072: nam='SQL*Net break/reset to client' ela= 120 driver id=1650815232 break?=0 p3=0 obj#=-1 tim=1514130832422252
WAIT #140496887317072: nam='SQL*Net message from client' ela= 595 driver id=1650815232 #bytes=1 p3=0 obj#=-1 tim=1514130832422889
CLOSE #140496887317072:c=0,e=14,dep=0,type=0,tim=1514130832422981
=====================
所以其实arraysize是1还是2,还是存在区别的。不过从10046上看却是没多大区别,从全表扫描或者其他能够正常返回结果的情况下,值为1和2是完全一样的。
但是实际上无论arraysize的值是多少,默认第一行单独会直接发送反馈给用户的,所以应该是不用设置的。
后边研究的逻辑读也有点问题,在12C里边差别更大。
其他:arraysize对逻辑读的影响
【Oracle】arraysize的研究(存在疑问)的更多相关文章
- Oracle索引技术研究
Oracle索引类型 B树索引 特定类型索引 确定索引列 主键和唯一键值列的索引 外键索引 其他合适的索引列 B树索引 B树索引算法 B树是指B-tree(Balanced Tree),B树的存在是为 ...
- oracle AWR深入研究分析,如何使用
AWR的前身是statspack,当然现在还在,只不过大家都在使用AWR,因为它方便,简单,直观,形象. AWR是oracle内置工具,安装oracle时已经自动安装完毕,无需额外安装了. SELEC ...
- Oracle 分页方法研究
1.Oracle 中的三大分页方法 1.1.通过分析函数分页 1.2.通过 ROWNUM 分页 1.3.通过 ROWID 分页 2.Oracle 分页解决方案浅析 2.1.纯后端代码完成分页 2.2. ...
- 从 Microsoft SQL Server 迁移到 Oracle
来源于:http://www.oracle.com/technetwork/cn/database/migration/sqlserver-095136-zhs.html Oracle SQL Dev ...
- 转Oracle字符集问题总结
Oracle字符集问题总结 分类: Oracle2006-06-04 13:48 1298人阅读 评论(3) 收藏 举报 oracle数据库sqlcharacter存储insert 作者: vston ...
- Oracle 字符集问题
1 简介 ORACLE数据库字符集,即Oracle全球化支持(Globalization Support),或即国家语言支持(NLS)其作用是用本国语言和格式来存储.处理和检索数据.利用全球化支持,O ...
- Oracle数据库字符集问题解析
Oracle数据库字符集问题解析 经常看到一些朋友问ORACLE字符集方面的问题,我想以迭代的方式来介绍一下.第一次迭代:掌握字符集方面的基本概念.有些朋友可能会认为这是多此一举,但实际上正是由于对相 ...
- 利用Oracle创建数据库
本文仅用于学习交流,商业用途请支持正版!转载请注明:http://www.cnblogs.com/mxbs/p/6217151.html 数据库的创建 打开"所有程序"-" ...
- Oracle下载与Oracle安装图解(Oracle19c,Oracle18c,Oracle12c,Oracle11g)
Oracle下载与Oracle安装图解(Oracle19c,Oracle18c,Oracle12c,Oracle11g) 1.Oracle下载(Oracle11g) oracle下载方法,请根据以下步 ...
随机推荐
- Java实现第九届蓝桥杯打印大X
打印大X 题目描述 如下的程序目的是在控制台打印输出大X. 可以控制两个参数:图形的高度,以及笔宽. 用程序中的测试数据输出效果: (如果显示有问题,可以参看p1.png) 高度=15, 笔宽=3 * ...
- java创建透明背景的PNG图片加自定义文字水印
人在码上走,需求天天有.这不,今天前端让我返回一个带自定义水印的背景图片.一通google,有现成的代码,但是基本是直接在源图上添加水印,生成出来的文字样式也没有控制好,看来又只有自己造轮子了. 过程 ...
- 在已经编译安装好php7场景下,install gd库 with free-type (解决Call to undefined function imagettftext())
在已经编译安装好php7场景下,install gd库 with free-type (解决Call to undefined function imagettftext()) install g ...
- 对SSH框架的理解
首先是对struts的理解.struts是把servlet.jsp以及众多标签库整合在一起的开源web框架,他实现了mvc设计模式.Struts实际上就是对MVC的各部件提供了现成的实现组件.Stru ...
- [computer graphics]世界坐标系->相机坐标系详细推导
基变换 理论部分 在n维的线性空间中,任意n个线性无关的向量都可以作为线性空间的基,即空间基不唯一.对于不同的基,同一个向量的坐标一般是不同的.因为在计算机图形学中,主要研究三维的空间,所以可以简化问 ...
- MacOS配置.bash_profile,重启终端后配置失效和MacOS .zshrc does not exist问题
MacOS配置.bash_profile,重启终端后配置失效和MacOS .zshrc does not exist问题 场景 在Mac中配置golang环境变量更改GOPATH路径,在~/.ba ...
- 创建使用mysql表
1.展示所有数据库 show databases;2.选中数据库 use database_name(;)3.创建数据库 create database database_name;4.使用2选中数据 ...
- 1.Go 开始搞起
link 1. IDE Go Land 服务器激活 2. 资源 中文网站 翻译组 翻译组wiki 待认领文章 入门指南 中文文档 fork 更新 github 中如何定期使用项目仓库内容更新自己 fo ...
- kali系统安装google拼音
1.设置多线程下载 /bin/bash -c "$(curl -sL https://git.io/vokNn)" 2.打开终端,输入下面的命令 apt-fast install ...
- [51nod 1847]奇怪的数学题
[ 51nod 1847 ]奇怪的数学题 题目 点这里看题目. 分析 是挺奇怪的...... 以下定义质数集合为\(P\),\(p_i\)为第\(i\)个质数. 定义\(mp(x)\) ...