Materialized Views Clustering; Materialized Views Using Other Materialized Views; Single Delta Materialized Views; Dml Operations On Materialized Views - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

The INSERT privilege is used to authorize the incremental REFRESH. You must have INSERT
privileges on a materialized view to be able to perform an incremental REFRESH on it.
You must have full access (SELECT, INSERT, and DELETE privileges) to the materialized view
to perform either initialize or recompute on the materialized view.
The INSERT and DELETE privileges on a materialized view can be granted by the creator of the
materialized view or any user that has a grant option. INSERT and UPDATE commands are
blocked on materialized views. The DELETE command on RECOMPUTE and ON STATEMENT
materialized views is blocked. The DELETE privilege on ON REQUEST MV enables the user to
perform deletes.

Materialized Views Clustering

Materialized views are automatically clustered as follows:
MAVs and MAJVs — The clustering key defaults to the set of all not null GROUP BY columns.
MJVs — The clustering key defaults to the MV SYSKEY and the clustering columns of one
of the base tables.
RECOMPUTE — RECOMPUTE materialized views are not automatically clustered.

Materialized Views Using Other Materialized Views

When one materialized view uses other materialized views, their refresh types must be compatible.
You cannot create an ON STATEMENT materialized view that uses an ON REQUEST materialized
view or any RECOMPUTE materialized views. An ON REQUEST materialized view can use ON
STATEMENT materialized views but not RECOMPUTE materialized views. RECOMPUTE
materialized views can be defined on any other type of materialized view.

Single Delta Materialized Views

A materialized view is single delta if it is based on a single table (base table or another materialized
view) or on a join where all tables but one are in the IGNORE CHANGES list.

DML Operations on Materialized Views

All update operations (INSERT, UPDATE, DELETE) are blocked on all materialized views except
for the DELETE operation on ON REQUEST materialized views.

Indexes and Materialized Views

Secondary indexes may be created automatically by the system for incremental MVs. These
indexes are designed to enhance the performance of the REFRESH operation.
For MJVs, the system-added secondary indexes are based on the underlying base tables' clustering
index columns. These indexes are not created for underlying tables with INSERTLOG attribute
or those tables that are included in the MV's IGNORE CHANGES clause. Neoview SQL tries to
minimize the number of secondary indexes created by the system based on the equal predicates
in the query expression.
For MAVs, the clustering index includes all the NOT NULL group-by columns. If some of the
group-by columns are nullable, the system generates a secondary index based on all the group-by
columns.
Secondary indexes created by the system for incremental REFRESH of MV might be expensive
to maintain. Neoview SQL allows users to remove indexes that were created by the system and
to create alternative indexes. If you remove system-added indexes and do not replace them with
alternative indexes, the performance of the REFRESH operation may be greatly hurt.
You can create additional secondary indexes, which cannot be unique.
CREATE MATERIALIZED VIEW Statement
63

Advertisement

Table of Contents
loading

Table of Contents