Oracle执行计划中的buffersort
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了Oracle执行计划中的buffersort,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2852字,纯文字阅读大概需要5分钟。
内容图文
![Oracle执行计划中的buffersort](/upload/InfoBanner/zyjiaocheng/556/d215601438f242068caf64570a9039a9.jpg)
Oracle 执行计划中的buffer sort实际上没有排序,只是把数据加载到内存,不扫描多次表。
Oracle 执行计划中的buffer sort实际上没有排序,只是把数据加载到内存,,不扫描多次表。
--制造数据
drop table test purge;
drop table test1 purge;
create table test as select * from dba_objects where rownum<10;
create table test1 as select * from dba_objects where rownum<10;
create index ind_t_object_id on test(object_id);
create index ind_t1_object_id on test1(object_id);
exec dbms_stats.gather_table_stats(user,'test',cascade => true);
exec dbms_stats.gather_table_stats(user,'test1',cascade => true);
--执行SQL
select /*+gg_test*/* from test t, test1 t1 where t.object_name like 'T%';
----------------------------------------------------------
Plan hash value: 702683263
------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 9 | 1350 | 6 (0)| 00:00:01 |
| 1 | MERGE JOIN CARTESIAN| | 9 | 1350 | 6 (0)| 00:00:01 |
|* 2 | TABLE ACCESS FULL | TEST | 1 | 75 | 3 (0)| 00:00:01 |
| 3 | BUFFER SORT | | 9 | 675 | 3 (0)| 00:00:01 |
| 4 | TABLE ACCESS FULL | TEST1 | 9 | 675 | 3 (0)| 00:00:01 |
------------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
2 - filter("T"."OBJECT_NAME" LIKE 'T%')
统计信息
----------------------------------------------------------
1 recursive calls
0 db block gets
3 consistent gets
0 physical reads
0 redo size
1991 bytes sent via SQL*Net to client
348 bytes received via SQL*Net from client
1 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
0 rows processed
--#keys=0表示没有排序,Oracle中如何判断SQL是否真正做了排序
select projection
from v$sql_plan_statistics_all
where sql_id in(select sql_id from v$sql where
sql_text like'select /*+gg_test*/* from test t, test1 t1 where t.object_name like ''T%'' ')
and operation='BUFFER' and options='SORT';
(#keys=0) "T1"."OWNER"[VARCHAR2,30], "T1"."OBJECT_NAME"[VARCHAR2,128], "T1"."SUBOBJECT_NAME"[VARCHAR2,30], "T1"."OBJECT_ID"[NUMBER,22], "T1"."DATA_OBJECT_ID"[NUMBER,22], "T1"."OBJECT_TYPE"[VARCHAR2,19], "T1"."CREATED"[DATE,7], "T1"."LAST_DDL_TIME"[DATE,7], "T1"."TIMESTAMP"[VARCHAR2,19], "T1"."STATUS"[VARCHAR2,7], "T1"."TEMPORARY"[VARCHAR2,1], "T1"."GENERATED"[VARCHAR2,1], "T1"."SECONDARY"[VARCHAR2,1], "T1"."NAMESPACE"[NUMBER,22], "T1"."EDITION_NAME"[VARCHAR2,30]
本文永久更新链接地址:
内容总结
以上是互联网集市为您收集整理的Oracle执行计划中的buffersort全部内容,希望文章能够帮你解决Oracle执行计划中的buffersort所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。