I materialize the result of a view in a table. I want to know if their is a way to know when the result of this view change to refresh it. Materialized view and result cache can do that but I don't want to use both techniques. Is their another way to answer to this question?
In fact we have a generic system who materialize and refresh views every n minutes. The cost for the refresh could be high and I try to know if we can know if underlying data has change or not.
We don't use materialized view because full refresh truncate the table and fast refresh work only on table with primary key.
Result cache can't do the job to because we don't have enough memory for that.
So I want to know if we could have a technique to know if underlying data of the view has change since last refresh
You could have a flag table that looks something like this:
Create a trigger on your base tables, where on INSERT, UPDATE, or DELETE of the table, you insert a record into FlagTable with the name of the base table
When you want to check for a refresh, just select WHERE Handled = 'N', refresh the pseudo-view, then set Handled = 'Y'