It's clear to me why a materialized view is preferable over just querying a base table. What is not so clear is the advantage over just creating another table with the same data as the MV. Is the only advantage to the MV really just the ease of creation/maintenance?
Isn't an MV equivalent to a table with matching schema and an INSERT INTO using the MVs SELECT statement?
Meaning, you can create an MV as follows
CREATE MATERIALIZED VIEW ... AS
SELECT * FROM FOO;
And you can create an equivalent table:
CREATE TABLE bar (....);
INSERT INTO bar
SELECT * FROM FOO;
Not to say that ease of creation / maintenance isn't enough of an advantage, I just want to make sure I'm not missing anything.
In additition to the already mentionned advantages:
I'd like to mention:
In addition to the other answers (because I haven't seen it), I would say that although they both use up space, the materialized view is logically normalized, whereas the extra table is logically denormalized. If this is something that is not a temporary one-off, you will have to remember to update the second table whenever you update the base table.
Materialize views are in fact best choice over tables where aggregations are required regularly to show updated result sets. We can use Materialized view other than Data ware housing in Inventory modules for calculating daily, weekly, monthly stock with closing balance rather than using complex queries every time , we can make materialized views to fetch such results in no time.
Dynamic query rewriting. Materialized views define not only relationships, but also allow you to precompute expensive joins and aggregations. The optimizer is smart enough to use the MV to fetch relevant data even if the MV isn't explicitly used in the query (given DB settings, etc).
Your question was tagged as Oracle, but MSSQL also does similar tricks.
The materialized view will stay synchronized with the base relations on which it depends.
If the materialized view is updatable, when you modify the materialized view, it will also modify the base relation on which it depends.
1) Speeding up write operations: Since indexes can be created on materialized views, reading from them is very fast. Note that if you create an index on a table that includes a lot of writes, index maintenance overhead tends to slow down the write process. To avoid this you can create a materialize view and create indexes on them. These indexes can be maintained in the background and does not adversely affect table write operations.
2) Speeding read operations: Complex joins; pivots that take ages to run can be speed up by creating indexes on the materialized views. This becomes very handy in most reporting scenarios.