alter precomputed result set

Description

Alters the properties or policies of a precomputed result set

Syntax

alter {precomputed result set | materialized view} 
		[owner_name.]prs_name 
	[{immediate | manual } refresh] 
	[enable | disable] 
	[{enable | disable } use in optimization]

Parameters

precomputed result set | materialized view

alters a materialized view or precomputed result set.

prs_name

name of the precomputed result set. A fully qualified prs_name cannot include the server or database name.

{immediate | manual} refresh

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.

enable | disable

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.

{enable | disable} use in optimization

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.

Examples

Example 1

Alters the authors_prs from a manual to an immediate refresh policy:

alter precomputed result set authors_prs
immediate refresh

Usage

Permissions

You must be the precomputed result set owner to execute the alter command.