Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Working with Database Objects » Working with views » Working with materialized views

Enabling and disabling materialized views Next Page

Enabling and disabling optimizer use of a materialized view


The optimizer maintains a list of materialized views that can be used in the optimization process. A materialized view is not considered a candidate for use in optimization if its definition includes certain elements that the optimizer rejects, or if it is considered too stale for use. For information about what qualifies a materialized view as a candidate in the optimization process, see Improving performance with materialized views.

By default, materialized views are available for use by the optimizer. However, you can disable optimizer's use of a materialized view unless it is explicitly referenced in a query.

To enable a materialized view's use in optimization (Sybase Central)
  1. Connect to the database as the DBA.

  2. Open the Views folder and right-click the materialized view.

  3. Select Properties.

    The Properties page for the materialized view displays.

  4. On the General tab, place a checkmark next to Used in optimization, and then choose OK.

To disable a materialized view's use in optimization (Sybase Central)
  1. Connect to the database as the DBA.

  2. Open the Views folder and right-click the materialized view.

  3. Select Properties.

    The Properties page for the materialized view displays.

  4. On the General tab, remove the checkmark next to Used in optimization, and then choose OK.

To enable a materialized view's use in optimization (SQL)
  1. Connect to the database as the DBA, or as owner of the materialized view.

  2. Execute an ALTER MATERIALIZED VIEW statement with the ENABLE USE IN OPTIMIZATION clause.

  3. To disable a materialized view's use in optimization (SQL)
    1. Connect to the database as the DBA, or as owner of the materialized view.

    2. Execute an ALTER MATERIALIZED VIEW statement with the DISABLE USE IN OPTIMIZATION clause.

    3. Examples

      The following statement enables the EmployeeConfidential view for use in optimization:

      ALTER MATERIALIZED VIEW EmployeeConfidential ENABLE USE IN OPTIMIZATION;

      The following statement disables the EmployeeConfidential view from use in optimization:

      ALTER MATERIALIZED VIEW EmployeeConfidential DISABLE USE IN OPTIMIZATION;
      See also