A method, apparatus, and article of manufacture for optimizing database
queries using a materialized view for a table referenced in the query,
wherein the materialized view has different properties than the referenced
table. The materialized view may be replicated across multiple processors
of the computer system, so that some or all of the query can be executed
in a local fashion wherein there is no data movement required to perform
the operations. The materialized view also may be partitioned across
multiple processors of the computer system using a different partitioning
key than the referenced table. The materialized view may be a vertical
and/or horizontal subset of the table, so that only selected columns
and/or tuples from the table are present therein. Columns may be added to
the materialized view to contain pre-computed results of complex
expressions, and indices may be created on the columns of the materialized
view.