Oracle with as (hint inline materialize)
发表于:2026-11-02 作者:千家信息网编辑
千家信息网最后更新 2026年11月02日,测试数据:SQL> create table test1 as select * from dba_objects;Table created.SQL> create table test2 as
千家信息网最后更新 2026年11月02日Oracle with as (hint inline materialize)
测试数据:
SQL> create table test1 as select * from dba_objects;Table created.SQL> create table test2 as select * from user_objects;Table created.SQL> create table test3 as select * from dba_objects;Table created.
收集统计信息:
BEGIN DBMS_STATS.GATHER_TABLE_STATS(ownname => 'SCOTT', tabname => 'TEST1', estimate_percent => 100, method_opt => 'for columns owner size repeat', no_invalidate => FALSE, degree => 4, granularity => 'ALL', cascade => TRUE); END; /PL/SQL procedure successfully completed.SQL> with t as(select t1.* from test1 t1,test2 t2 where t1.object_id=t2.object_id) select * from t,test3 t3 where t.object_id=t3.object_id;11 rows selected.Execution Plan----------------------------------------------------------Plan hash value: 2878150729-------------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |-------------------------------------------------------------------------------------| 0 | SELECT STATEMENT | | 86999 | 16M| | 1605 (1)| 00:00:20 ||* 1 | HASH JOIN | | 86999 | 16M| | 1605 (1)| 00:00:20 || 2 | TABLE ACCESS FULL | TEST2 | 13 | 65 | | 3 (0)| 00:00:01 ||* 3 | HASH JOIN | | 86999 | 16M| 9352K| 1602 (1)| 00:00:20 || 4 | TABLE ACCESS FULL| TEST1 | 86997 | 8325K| | 347 (1)| 00:00:05 || 5 | TABLE ACCESS FULL| TEST3 | 86999 | 8326K| | 347 (1)| 00:00:05 |-------------------------------------------------------------------------------------Predicate Information (identified by operation id):--------------------------------------------------- 1 - access("T1"."OBJECT_ID"="T2"."OBJECT_ID") 3 - access("T1"."OBJECT_ID"="T3"."OBJECT_ID")Statistics---------------------------------------------------------- 0 recursive calls 0 db block gets 2491 consistent gets 2484 physical reads 0 redo size 3736 bytes sent via SQL*Net to client 523 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 11 rows processed 加 materialize hint,强制oracle生成临时表SQL> with t as(select /*+ materialize */t1.* from test1 t1,test2 t2 where t1.object_id=t2.object_id) select * from t,test3 t3 where t.object_id=t3.object_id;11 rows selected.Execution Plan----------------------------------------------------------Plan hash value: 3288461629----------------------------------------------------------------------------------------------------------------| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |----------------------------------------------------------------------------------------------------------------| 0 | SELECT STATEMENT | | 582M| 165G| | 3963 (40)| 00:00:48 || 1 | TEMP TABLE TRANSFORMATION | | | | | | || 2 | LOAD AS SELECT | SYS_TEMP_0FD9D661A_155646 | | | | | ||* 3 | HASH JOIN | | 86997 | 8750K| | 351 (1)| 00:00:05 || 4 | TABLE ACCESS FULL | TEST2 | 13 | 65 | | 3 (0)| 00:00:01 || 5 | TABLE ACCESS FULL | TEST1 | 86997 | 8325K| | 347 (1)| 00:00:05 ||* 6 | HASH JOIN | | 582M| 165G| 9352K| 3613 (44)| 00:00:44 || 7 | TABLE ACCESS FULL | TEST3 | 86999 | 8326K| | 347 (1)| 00:00:05 || 8 | VIEW | | 86997 | 17M| | 332 (1)| 00:00:04 || 9 | TABLE ACCESS FULL | SYS_TEMP_0FD9D661A_155646 | 86997 | 8750K| | 332 (1)| 00:00:04 |----------------------------------------------------------------------------------------------------------------Predicate Information (identified by operation id):--------------------------------------------------- 3 - access("T1"."OBJECT_ID"="T2"."OBJECT_ID") 6 - access("T"."OBJECT_ID"="T3"."OBJECT_ID")Statistics---------------------------------------------------------- 55 recursive calls 8 db block gets 2525 consistent gets 2485 physical reads 656 redo size 3736 bytes sent via SQL*Net to client 523 bytes received via SQL*Net from client 2 SQL*Net roundtrips to/from client 3 sorts (memory) 0 sorts (disk) 11 rows processed
信息
数据
强制
测试
生成
统计
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网加科技
中关村互联网 科技集团
米客互联网科技
新华互联网科技2019
互联网教育科技公司vipkid
广州恒生互联网科技有限
浙江互联网科技研学营
知域互联网科技有限公司大骗子
互联网5g黑科技有哪些
速维有品互联网信息科技(苏州)有限公司
坤平互联网科技
乌苏新华互联网科技做什么的
2021互联网科技公司排名
广州有谷有贝互联网科技有限公司
互联网硬科技公司
广州梦谷互联网科技有限公司领导
互联网科技收购价值
互联网科技对化妆品行业
互联网大会出现的黑科技
每日互联网科技新闻
西安纸贵互联网科技有限公司
中关村互联网 科技集团
科技互联网项目
互联网金融 科技
远拓互联网科技
宜昌元轩互联网科技有限公司
互联网科技公司营业执照怎么办理
宁波跨境商互联网科技有限公司
科技互联网经济论坛
互联网金融金融科技