Observation: Materialized View

The DB2 optimizer materialized a view referenced in the statement. This occurs when you have defined no base table in the view's subselect that DB2 can use to satisfy the select list of a SQL statement that references the view. View materialization results in the following:

  1. DB2 executes the subselect statement and places the results in a temporary table.

  2. DB2 executes the SQL statement that references the view against the temporary table.

Generally, views are materialized when some aggregate processing is specified in both the view subselect and in the SQL statement that references the view. Therefore, to avoid the overhead incurred by the materialization, review the use of the DISTINCT clause, column functions, and GROUP BY in the SQL statement and the views the statement references.