Considerations For Create Materialized View - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

embedded inserts, updates, or deletes. For the syntax and syntax description of the
order-by-clause, see
mv-attributes
The COMMIT REFRESH EACH attribute is only allowed for ON REQUEST materialized
views that are defined on single delta materialized views. A single delta materialized view
is a materialized view that can be refreshed based on changes to a single table. So, a MAV
or a single delta MAJV (a materialized view that ignores updates for all the tables in the
FROM clause except one table) can specify the COMMIT REFRESH EACH. n-rows refers
to the number of rows that refresh processes from the log before committing a transaction
and starting another one. There is no recommended value for n-rows, but the number must
be less than 5000. The default value is zero (0), which means that the entire refresh for the
materialized view is done in one transaction.

Considerations for CREATE MATERIALIZED VIEW

Materialized aggregate views do not support the DISTINCT clause as an argument of the
aggregate function. Additionally, aggregate functions as subqueries in an aggregate function
expression are not allowed.
If optional column names for the materialized view are not specified, they default to the
column names (or derived names) specified in the materialized view query expression.
You can specify GROUP BY using ordinals to refer to the relative position within the SELECT
list. For example, GROUP BY 3, 2, 1.
ON REQUEST and ON STATEMENT materialized views cannot be created on views.
Types of Materialized Views
Neoview SQL defines the following three types of materialized views:
Materialized Join View (MJV): An ON STATEMENT or ON REQUEST materialized view
holds the results of a join query with inner equi-joins of several tables. Outer joins and cross
joins are not supported. These tables can be base tables or other materialized views. The
query does not include aggregations. A materialized view on a single table without an
aggregate is also an MJV.
Materialized Aggregate View (MAV): An ON REQUEST materialized view holds the result
of a GROUP BY query with any of these aggregate functions: SUM, AVG, VARIANCE,
STDDEV, MIN, MAX, COUNT(*), and COUNT(x). The aggregate function can include
expression on the columns, such as SUM(a+b). Aggregate materialized views can be of two
types:
— MAV on Single Table: the MAV is defined on a single base table or materialized view.
— MAV on Explicit Join (MAJV): the MAV is defined on an inner equi-join of several base
tables, materialized views, or both.
RECOMPUTE materialized views: A materialized view that is initialized every time the
materialized view needs to be updated with changes to its base tables. RECOMPUTE
materialized views can hold the result of any query that can be specified for a regular view.
Authorization
Materialized views have the same security policies as regular views, which are independent of
those of its underlying tables.
The creator of a materialized view must have privileges both on the objects the view references
and for the schema. Privileges required to create the object include the SELECT privilege. To
grant a SELECT privilege on the materialized view to another user, the creator of the materialized
view must have the grant option on the underlying objects. In order to create a materialized view
in the schema, the creator must be the schema owner or have the CREATE privilege.
"SELECT Statement" (page
164).
CREATE MATERIALIZED VIEW Statement
65

Advertisement

Table of Contents
loading

Table of Contents