Queries that are eligible for rewrite
Db2 supports automatic query rewrite only for read-only, dynamic queries that do not contain parameter markers. Db2 cannot automatically rewrite statically bound queries.
You can always refer to a
materialized query table explicitly in a statically bound query or
in a dynamically prepared query. However, you should consider updating
materialized query table data more frequently if you frequently query
the table directly. Also, allowing users to refer directly to materialized
query tables reduces an installation's flexibility of dropping and
creating materialized query tables without affecting applications.