Materialized View:- Materialized view is just like a snapshot. We create materialized view when query take lot of time for execution and in our code it execute many times.
CREATE MATERIALIZED VIEW VIEW_NAME
AS SELECT ………;
â€¢IMMEDIATE : The materialized view is populated immediately.
â€¢DEFERRED : The materialized view is populated on the first requested refresh.(WHEN WE DONOT REFERESH MANULLY THEN DATA DOES NOT COMES IN MATERIALIZED VIEW)
â€¢FAST : A fast refresh is attempted. If materialized view logs are not present against the source tables in advance, the creation fails.
â€¢COMPLETE : The table segment supporting the materialized view is truncated and repopulated completely using the associated query.
â€¢FORCE : A fast refresh is attempted. If one is not possible a complete refresh is performed.
â€¢ON COMMIT : The refresh is triggered by a committed data change in one of the dependent tables.
â€¢ON DEMAND : The refresh is initiated by a manual request or a scheduled task
CREATE MATERIALIZED VIEW XXC_ALL_OBJECTS
SELECT * FROM ALL_OBJECTS;
SELECT COUNT(*) FROM ALL_OBJECTS;
SELECT COUNT(*) FROM XXC_ALL_OBJECTS;