Alters the properties or policies of a precomputed result set
alter {precomputed result set | materialized view} [owner_name.]prs_name [{immediate | manual } refresh] [enable | disable] [{enable | disable } use in optimization]
alters a materialized view or precomputed result set.
name of the precomputed result set. A fully qualified prs_name cannot include the server or database name.
determines the refresh policy:
immediate – (the default) the precomputed result set is updated during the same transaction that updates the base tables.
manual – the precomputed result set is explicitly updated. When you use the manual parameter, updates to the base tables are not reflected in the precomputed result set until you explicitly issue refresh. Because precomputed result sets set to manual are not maintained, Adaptive Server considers them to be stale, even after you issue the refresh parameter, and therefore the query processor selects this data for query rewrite only if the query accepts stale data.
specifies whether the precomputed result set is available for operations. This option overrides all other precomputed result set options.
enable – (the default) the precomputed result set is available for operations. Only precomputed result sets configured for enable are maintained according to their refresh policy.
disable – the precomputed result set is not available for operations. Disabled precomputed result sets are not considered for maintenance or query rewrites. If a precomputed result set is configured for disable, it is not:
Used for the query rewrite during optimization, whether or not you specify use in optimization.
Populated, whether or not you specify with populate.
specifies whether to include a precomputed result set for query rewrite during optimization. use in optimization is enabled by default. Precomputed result sets are considered for query rewrite depending on how their refresh parameter is set:
immediate – considered for all queries.
manual – considered only if the query accepts stale data.
Alters the authors_prs from a manual to an immediate refresh policy:
alter precomputed result set authors_prs immediate refresh
Precomputed result sets are automatically refreshed when you change them from a manual to an immediate refresh policy.
If the base table or view on which the precomputed result set is based is dropped or altered, the precomputed result set is automatically altered to disable.
You must be the precomputed result set owner to execute the alter command.