Does a refresh fast on commit union all materialized view (in Oracle) copy all the underlying data, or does it just have a reference to it?
If this materialized view does copy all the data is there anyway to do the following:
create table3 as ( table1 union all table2 );
So that I can create indexes and materialized view logs on table3, and table 3 is just a reference to table 1 and table 2.
The reason for this is I want put the following in a materialized view:
create materialized view mat1
refresh fast on commit
(
select data, count(*)
from (table1 union all table2)
group by data
);
But the above isn't fast refreshable.
But the following sort of thing works:
create materialized view mat1
refresh fast on commit
(
select data from table1
union all
select data from table2
);
create materialized view mat2
refresh fast on commit
(
select data, count(*)
from mat2
group by data
);
But I'm concerned the first materialized view is unnecessarily replicating all the data.