94 High-Function Business Intelligence in e-business
– If in a multiple partition database partition group, the partitioning key must
be a subset of the GROUP BY items.
No duplicate rows in materialized view restriction
The materialized view must not contain duplicate rows, and the following
restrictions specific to this uniqueness requirement apply, depending upon
whether or not a GROUP BY clause is specified.
? When a GROUP BY is specified, the following uniqueness related restrictions
apply:
– All GROUP BY items must be included in the select list.
– When the GROUP BY contains GROUPING SETS, CUBE or ROLLUP,
then the GROUP BY items and associated GROUPING column functions
in the select list must form a unique key of the result set. Thus, the
following restrictions must be satisfied:
• No grouping sets may be repeated. For example, ROLLUP(X,Y),X is
not allowed because it is equivalent to GROUPING
SETS((X,Y),(X),(X))
• If X is a nullable GROUP BY item that appears within GROUPING
SETS, CUBE, or ROLLUP, then GROUPING(X) must appear in the
select list
? When a GROUP BY clause is
not specified, the following uniqueness related
restrictions apply:
– The materialized view’s non-duplicate requirement is achieved by deriving
a unique key for the materialized view from one of the unique key
constraints defined in each of the underlying tables. Therefore, the
underlying tables must have at least one unique key constraint defined on
them, and the columns of these keys must appear in the select list of the
materialized view definition.