In Oracle, what is insert-only materialized view?
I have the following materialized view that uses the aggregate function MAX :
CREATE MATERIALIZED VIEW VM_FAST_MAX REFRESH FAST ON COMMIT AS SELECT d.ID_INPUT, MAX(d.ID_LOAD) AS ID_LOAD, COUNT(*) AS CNT FROM MASTER_TABLE d GROUP BY d.ID_INPUT;
According to the Oracle Data Warehouse Guide , it should only be an insert materialized view:
If the materialized view has one of the following meanings, then fast updates are only supported on regular DML inserts and direct loads.
- Materialized views with MIN or MAX aggregates
- Materialized views having SUM (expr) but not COUNT (expr)
- Materialized views without COUNT (*)
Such a materialized representation is called a materialized representation only in the form.
I would expect such a materialized view to be updated quickly only when pasted into the main table. Instead, DBMS_MVIEW.EXPLAIN_MVIEW tells me that this materialized view always updates quickly:
EXEC DBMS_MVIEW.EXPLAIN_MVIEW('VM_FAST_MAX'); SELECT CAPABILITY_NAME, POSSIBLE FROM MV_CAPABILITIES_TABLE WHERE MVNAME = 'VM_FAST_MAX'; CAPABILITY_NAME P
And a quick transaction update works even after updates in the main table.
Repeat:
- What is the difference between a materialized view just for insertion and a simple, quickly updated materialized view?
- Why is Oracle documentation for me? :)
Using Oracle 11.2 Enterprise Edition
source share