imp buffer=? & array insert

王朝other·作者佚名  2008-05-31
宽屏版  字体: |||超大  

在导入数据的时候,假如commit=Y,则由参数Buffer决定导入过程中什么时候做Commit操作。*(Note:"For tables containing LONG, LOB, BFILE, REF, ROWID, UROWID columns, array inserts are not done. If COMMIT=y, Import commits these tables after each row.")

导入的时候,Oracle使用Array Insert.将record从dmp file中读取到imp process buffer中,当buffer“满”的时候,Bind Array,执行Insert.

看来Oracle也通过批量绑定来提高imp性能,以前还以为是read one record,insert one record,read one record,insert one record……

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

INSERT /*+NESTED_TABLE_SET_REFS+*/ INTO "T_1K" ("X")VALUES (:1)

call count cpu elapsed disk query current rows

------- ------ -------- ---------- ---------- ---------- ---------- -------

Parse 1 0.00 0.01 0 4 0 0

Execute 102 0.02 0.04 0 11 174 6601

Fetch 0 0.00 0.00 0 0 0 0

------- ------ -------- ---------- ---------- ---------- ---------- -------

total 103 0.02 0.05 0 15 174 6601

Misses in library cache during parse: 1

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

表T_1K每个记录在imp的时候占用大概1k的buffer,如上是设置了buffer=64k imp的结果。

Array Bind (Commit)102次,导入纪录6601条

6601/102 =64.7156863 about 64 rows/insert, using a 64k buffer —— that makes sense

看不出Oracle内部使用array bind 的地方挺多的: arraysize in sqlplus, Forall bind / fetch in PL/SQL……

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有