问题
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).
I want to have all data but refresh last 2 day's data. Is there any solution for my problem?
thanks.
回答1:
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)
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.
来源:https://stackoverflow.com/questions/24609631/refresh-a-complex-materialized-view