- 最后登录
- 2017-1-25
- 在线时间
- 19 小时
- 威望
- 29
- 金钱
- 202
- 注册时间
- 2012-1-19
- 阅读权限
- 10
- 帖子
- 17
- 精华
- 0
- 积分
- 29
- UID
- 184
|
8#
发表于 2012-6-4 11:38:08
不好意思,今天才回复2位大佬!
C:\>sqlplus scott/tiger
SQL*Plus: Release 11.2.0.3.0 Production on 星期一 6月 4 11:09:03 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select owner,table_name,constraint_name,constraint_type from dba_constraints where r_owner='SCOTT' and r_constrain
t_name='PK_TX';
未选定行
SQL>
COPY一个表测试一次:
SQL> create table tx2 as select * from TX;
表已创建。
已用时间: 00: 00: 02.70
SQL> alter table tx2 add constraint pk_tx2 primary key(COL1,COL2);
表已更改。
已用时间: 00: 00: 04.40
SQL> set autotrace on
SQL> delete from tx2;
已删除810620行。
已用时间: 00: 02: 36.63
执行计划
----------------------------------------------------------
Plan hash value: 2562528842
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
---------------------------------------------------------------------------
| 0 | DELETE STATEMENT | | 1 | 22 | 1058 (1)| 00:00:13 |
| 1 | DELETE | TX2 | | | | |
| 2 | TABLE ACCESS FULL| TX2 | 1 | 22 | 1058 (1)| 00:00:13 |
---------------------------------------------------------------------------
Note
-----
- dynamic sampling used for this statement (level=2)
统计信息
----------------------------------------------------------
1621533 recursive calls ==还是一样多
3310720 db block gets
4067 consistent gets
7258 physical reads
407890616 redo size
848 bytes sent via SQL*Net to client
768 bytes received via SQL*Net from client
3 SQL*Net roundtrips to/from client
8 sorts (memory)
0 sorts (disk)
810620 rows processed
SQL>
SQL> |
|