Maintenance of materialized view for query optimization in a database. The
architecture provides the first practical algorithms for incrementally
maintaining views with multiple outer joins and aggregated outer-join
views. Materialized views with any combination of inner joins, one-sided
outer joins and full outer joins, plus an optional aggregation on top,
can be processed by algorithm(s) that construct incremental maintenance
expressions based on converting the view definition a join-disjunctive
normal form and exploiting database constraints to reduce maintenance
overhead. A system comprises a view creation component for creating a
materialized view definition that includes outer-joins, a conversion
component for converting an outer-join view expression into a normal
form, and a maintenance component for updating the stored materialized
view result associated with the materialized view definition.