试发现,Oracle不支持全外连接的查询重写,即使物化视图和查询语句完全匹配。
在10g中测试发现对于全外连接,创建语句一致的物化视图也无法利用查询重新功能:
[oracle@yans1 ~]$ sqlplus test/test
SQL*Plus: Release10.2.0.3.0 - Production on星期一10月18 12:16:47 2010
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
Connected to:
Oracle Database10gEnterprise Edition Release10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> SET PAGES 100 LINES 120
SQL> SHOW PARAMETER QUERY
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
query_rewrite_enabled string TRUE
query_rewrite_integrity string enforced
SQL> CREATE MATERIALIZED VIEW MV_T1_FULL_JOIN_T2
2 ENABLE QUERY REWRITE AS
3 SELECT T1.ID ID1, T2.ID ID2
4 FROM T1 FULL OUTER JOIN T2
5 ON T1.ID = T2.ID;
Materialized view created.
SQL> SET AUTOT ON
SQL> SELECT T1.ID ID1, T2.ID ID2
2 FROM T1 FULL OUTER JOIN T2
3 ON T1.ID = T2.ID;
ID1 ID2
---------- ----------
2 2
3 3
4 4
5 5
6 6
7 7
8 8
1
0
10
9
11 rows selected.
Execution Plan
----------------------------------------------------------
Plan hash value: 2841162349
-----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
-----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 10 | 260 | 13 (8)| 00:00:01 |
本栏目更多精彩内容:http://www.bianceng.cn/database/Oracle/
| 1 | VIEW | | 10 | 260 | 13 (8)| 00:00:01 |
| 2 | UNION-ALL | | | | | |
|* 3 | HASH JOIN OUTER | | 9 | 234 | 7 (15)| 00:00:01 |
| 4 | TABLE ACCESS FULL| T1 | 9 | 117 | 3 (0)| 00:00:01 |
| 5 | TABLE ACCESS FULL| T2 | 9 | 117 | 3 (0)| 00:00:01 |
|* 6 | HASH JOIN ANTI | | 1 | 26 | 7 (15)| 00:00:01 |
| 7 | TABLE ACCESS FULL| T2 | 9 | 117 | 3 (0)| 00:00:01 |
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索sql
, oracle
, 查询
, 00
, id
, hibernate全外连接
, full
重写View
oracle 无效数字、oracle无效的列索引、oracle 标识符无效、oracle 无效字符、oracle 无效的列类型,以便于您获取更多的相关知识。