create as & insert into 语句性能分析
2015-04-07 10:41
357 查看
1、会话设置
2、格式化mysession生成的trace文件;
结果显示 insert into 相较create table而言在查询插入时所消耗的资源较高。
alter session set sql_trace=true; alter session set tracefile_identifier='mysession'; create table t2 as select * from t1;
2、格式化mysession生成的trace文件;
Plan Hash: 1069440229 create table t2 as select * from t1 call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 1 0.00 0.00 0 1 0 0 Execute 1 0.06 0.06 1 423 927 80050 Fetch 0 0.00 0.00 0 0 0 0 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 2 0.06 0.06 1 424 927 80050 Misses in library cache during parse: 1 Optimizer mode: ALL_ROWS Parsing user id: 84 Rows Row Source Operation ------- --------------------------------------------------- 0 LOAD AS SELECT (cr=555 pr=1 pw=377 time=0 us) 80050 TABLE ACCESS FULL T1 (cr=381 pr=0 pw=0 time=12148 us cost=109 size=7024522 card=88918) insert into SQL ID: 6xcqhqnm53x7g Plan Hash: 3617692013 insert into t3 select * from t1 call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 1 0.00 0.00 0 1 0 0 Execute 1 0.12 0.22 2 1165 4334 80050 Fetch 0 0.00 0.00 0 0 0 0 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 2 0.13 0.22 2 1166 4334 80050 Misses in library cache during parse: 1 Misses in library cache during execute: 1 Optimizer mode: ALL_ROWS Parsing user id: 84 Rows Row Source Operation ------- --------------------------------------------------- 0 LOAD TABLE CONVENTIONAL (cr=0 pr=0 pw=0 time=0 us) 1 TABLE ACCESS FULL T1 (cr=4 pr=0 pw=0 time=0 us cost=109 size=7024522 card=88918)
结果显示 insert into 相较create table而言在查询插入时所消耗的资源较高。
相关文章推荐
- "CREATE TABLE AS SELECT"以及"INSERT INTO AS SELECT"语句的优化
- SELECT INTO , INSERT INTO SELECT 和 CREATE TABLE AS SELECT 性能对比
- Insert into select 与create table as的性能测试及create table
- oracle数据迁移--复制表--create table as select & select into & insert into
- insert into select 与 create table as的用法和区别
- 造成ORA-01843 无效的月份 的一些原因 1) 当我们在一个中文环境的客户端使用如下sql语句 INSERT INTO "temptable" ( DELIVER_DATE ) VALUES
- MySQL Insert语句单个批次数量过多导致的CPU性能问题分析
- MYSQL 执行Insert语句throws "The table 'xxx' is full" 的问题分析及解决办法
- MySQL Insert语句单个批次数量过多导致的CPU性能问题分析
- SELECT INTO , INSERT INTO SELECT 和 CREATE TABLE AS SELECT 的区别
- 常用语句(一)create、insert into...values(...)、truncate、distinct、having、inner join ... on...
- create table as select 和 create table 再insert into select 的差异
- 使用OleDbCommandBuilder时出现“Insert into 语句的语法错误”的解决方法
- OleDbDataAdaper.Update(DataSet ds,TableName name) 总是报"Insert Into 的语句语法错误".
- 表里有一些默认的数据 用什么方法生成一条一条的insert into语句
- (转)ORACLE UPDATE 语句语法与性能分析的一点看法
- ORACLE UPDATE 语句语法与性能分析的一点看法
- 分析SQL语句的性能-- Compare NText Column value by using CheckSum
- ORACLE UPDATE 语句语法与性能分析
- INSERT INTO语句中直接插入一条SELECT语句