刷新复杂的物化视图 [英] Refresh a Complex Materialized View

查看:78
本文介绍了刷新复杂的物化视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个物化视图,并且对其声明使用了一些联接.现在我有一个刷新问题.它花费的时间太长(甚至超过一个小时).

I have a materialized view and I used some joins for it's statement. And now I have a refresh problem with it. It takes too long time (even more than an hour).

我想拥有所有数据,但要刷新最近2天的数据.我的问题有什么解决办法吗?

I want to have all data but refresh last 2 day's data. Is there any solution for my problem?

谢谢.

推荐答案

要提高查询的性能,请尝试使用google提高查询性能".您可能想知道一些技巧. (或者我可以建议您一些)

To improve the performance of your query try google for "improving query performance". There are a few tips you might want to know. (or I could suggest you some if you want)

如果只有在无法提高查询性能的情况下,这是我的建议: 创建2个物化视图: 其中之一保留除过去两天以外的所有数据,并创建一个工作来整夜刷新数据. 另一个仅保留最近2天的数据.您可以在需要时刷新它,并且可能工作得更快. 然后在这两个视图之间创建一个并集视图.

IF and only if the performance of your query cannot be improved, this is my suggestion: Create 2 materialized views: One of them keeping all data except last 2 days and create a job to refresh it over the night. The other one keeping only the data for the last 2 days. You may refresh it when you want and probably might work much faster. Then create an union view between these 2 views.

这篇关于刷新复杂的物化视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆