You can enable Db2 to rewrite
certain queries to use materialized query tables instead of base tables
for faster processing.
To take advantage of automatic
query rewrite with materialized query tables:
- Define materialized query tables.
- Populate materialized query tables.
- Refresh materialized query tables periodically to maintain
data currency with base tables.
However, realize that refreshing
materialized query tables can be an expensive process.
- Enable automatic query rewrite, and exploit its functions
by submitting read-only dynamic queries.
- Evaluate the effectiveness of the materialized query tables.
Drop under-used tables, and create new tables as necessary.