【Oracle】arraysize的研究(存在疑問)
-
SYS@proc> desc aaa;
-
Name Null? Type
-
----------------------------------------- -------- ----------------------------
-
ID1 NUMBER(38)
-
ID2 NUMBER(38)
-
ID3 NUMBER(38)
-
ID4 NUMBER(38)
-
-
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> drop table aaa2 purge;
-
-
Table dropped.
-
-
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>
-
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.
-
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的值是多少,預設第一行單獨會直接傳送反饋給使用者的,所以應該是不用設定的。
後邊研究的邏輯讀也有點問題,在12C裡邊差別更大。
其他:http://www.itpub.net/thread-242144-1-1.html
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30174570/viewspace-2149212/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- oracle疑問和解答Oracle
- 我的疑問
- Oracle 調優確定存在問題的SQLOracleSQL
- Ibatis的疑問BAT
- 快取的疑問快取
- 橋模式的疑問模式
- 有些疑問
- JPetStore架構的疑問架構
- 工廠模式的疑問模式
- Composite模式的疑問模式
- Jive原始碼的疑問原始碼
- 初學者的小疑問
- 最近看JdonFramework的疑問Framework
- 初學JAVA的疑問。。Java
- 常見問題--oracle物件不存在Oracle物件
- ORACLE懸疑分散式事務問題處理Oracle分散式
- pycharm 小疑問PyCharm
- 對於晶晶小妹發表的構造ORACLE的CR block的疑問OracleBloC
- asynchttpclient 使用的一點疑問HTTPclient
- 控制檔案大小的疑問
- 關於TargetServiceFactoryVisitable的疑問
- Arraysize 對consistent get的影響
- 人工智慧學會主席:中國人工智慧研究存在問題人工智慧
- composite模式疑問模式
- 面試疑難問題面試
- oracle中extents存在的理由Oracle
- go path 存在的問題Go
- 關於 dingo API 的疑問GoAPI
- 有關事件的一點疑問事件
- 關於jdonframework框架的小疑問Framework框架
- 關於設計模式的疑問設計模式
- 增刪改查框架的疑問框架
- Oracle 11g存在密碼過期問題Oracle密碼
- 關於Oracle臨時表的使用的小經歷和一點疑問?Oracle
- Oracle arraysize 和 fetch size 引數 與 效能優化 說明Oracle優化
- liferay的cache的實現疑問
- maven的編碼問題、解決和疑問Maven
- GO 指標*&問題疑問Go指標