Oracle-Materialized View,这个MV可以快速刷新吗?
我有一个看起来有点像下面的物化视图,我想知道是否有办法让这个物化视图“快速”刷新?基本上,我要问以下问题:
物化视图可以包含 Oracle 函数(例如 COALESCE、NVL、NVL2 等)并且仍然可以快速刷新
物化视图可以包含我所做的功能并且仍然可以快速刷新吗?
物化视图可以包含与派生表的联接并且仍然可以快速刷新吗?
我检查了关于此的 Oracle 文档 ,并且它没有列出这些限制,但是在我自己的系统上测试下面的情况后,我不相信这是可能的。
甲骨文版本:10g
SELECT COALESCE (col1, col2),
myOracleFunction(col3, col4)
FROM tableA a
LEFT OUTER JOIN
(SELECT id, MAX (sample_key) prim_sam_key
FROM table_sample
GROUP BY id
HAVING COUNT (1) = 1) b ON a.id = b.id;
I have a materialized view that looks somewhat like the following and I'm wondering if there is anyway to have this materialized view 'fast' refreshable? Basically, I'm asking the following:
Can a materialized view contain oracle functions such as COALESCE, NVL, NVL2, etc and still be fast refreshable
Can a materialized view contain functions that I have made and still be fast refreshable.
Can a materialized view contain joins to derived tables and still be fast refreshable?
I checked the Oracle documentation about this, and it did not list these restrictions, however after testing the case below on my own system, I don't believe it is possible.
Oracle version: 10g
SELECT COALESCE (col1, col2),
myOracleFunction(col3, col4)
FROM tableA a
LEFT OUTER JOIN
(SELECT id, MAX (sample_key) prim_sam_key
FROM table_sample
GROUP BY id
HAVING COUNT (1) = 1) b ON a.id = b.id;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您提供的链接中的要求你缺少:
此外,以下要求表明,对于您的查询,只有在
table_sample
已更新但tableA
尚未更新时才可能进行快速刷新:最后,当询问物化视图时,最好准确地说明您创建了哪些物化视图日志。
Requirements from the link you provided that you're missing:
Also, the following requirement indicates that, for your query, a fast refresh will only be possible if
table_sample
has been updated, buttableA
has not:Finally, when asking about materialized views, it is always a good idea to state exactly what materialized view logs you have created.