HP Neoview SQL Reference Manual page 61

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

column-name-list
specifies names for the columns in the materialized view, as well as headings for the columns.
Column names in the list correspond directly to columns in the query-expr. If you omit
this clause, columns in the materialized view will have the same names as the corresponding
columns in the query-expr. If a column in query-expr does not have an implicit name
(for example, a function) and an explicit name is not specified using the AS syntax, the
column-name-list must be specified or an error is returned. You must specify this clause
if any two columns in the tables specified by query-expr have the same name.
column-name-list is optional.
You can specify GROUP BY using ordinals to refer to the relative position within the SELECT
list. For example, GROUP BY 3, 2, 1.
INITIALIZE ON CREATE
implies that the materialized view gets its initial content upon its creation. A materialized
view that is based on another materialized view can be initialized on create only if the query
expression does not include joins and if the underlying materialized view is already initialized.
This restriction is required in order to guarantee the consistency of the materialized view.
INITIALIZE ON REFRESH
implies that the materialized view gets its initial content on its first refresh, assuming the
underlying tables have been updated.
refresh-type
specifies the method that will be used to update the materialized view.
ON REQUEST
this method implies the incremental maintenance of the materialized view. The
materialized view has to be explicitly refreshed through the MAINTAIN command.
ON STATEMENT
a materialized view that is refreshed ON STATEMENT is often called immediate. An ON
STATEMENT materialized view is maintained automatically as part of the statement that
updated any of the base tables that are part of the materialized view, just like indexes.
Therefore, immediate materialized views are always fully consistent with the database
base tables but are expected to slow down the update transactions. Only ON STATEMENT
materialized joined views are supported. ON STATEMENT materialized aggregate views
and ON STATEMENT MAV on Explicit Join (MAJV) are not supported.
ignore-changes
The IGNORE CHANGES ON clause instructs the refresh operation of a materialized view
over several base tables to ignore the changes to the listed base tables. This clause is applicable
only to ON REQUEST MAJVs and ON REQUEST MJVs. At least one table from the FROM
clause of the MV should not appear in the IGNORE CHANGES ON clause. Also, only base
tables from the FROM clause of the MV can appear in the IGNORE CHANGES ON clause.
The IGNORE CHANGES list cannot include MVs.
file-options
is a subset of the table file option (see
The STORE BY and PARTITION BY clauses are only required for RECOMPUTE materialized
views. ON REQUEST and ON STATEMENT materialized views are automatically clustered
and partitioned by Neoview.
STORE BY (key-column-list)
The STORE BY clause specifies the order of rows within the physical file that holds the table,
determines the physical organization of the table, and the ways you can partition the table.
The storage key is referred to as the clustering index. You define the clustering index for the
materialized view table using the column list. The key columns in the key-column-list
must be NOT NULL columns from the materialized view query expression.
HASH PARTITION BY (key-column-list)
the"CREATE TABLE Statement" (page
CREATE MATERIALIZED VIEW Statement
69).
61

Advertisement

Table of Contents
loading

Table of Contents