Enabling or disabling optimizer use of a materialized view

Even if a query doesn't reference a materialized view, the optimizer can decide to use the view to satisfy a query if doing so improves performance. You can enable or disable the optimizer's use of a materialized view for satisfying queries.

Prerequisites

You must have DBA authority or be the owner of the materialized view.

Context and remarks

Many.

 Enable or disable a materialized view's use in optimization using Sybase Central
  1. Use the SQL Anywhere 12 plug-in to connect to the database.

  2. In the left pane, double-click Views.

  3. Right-click the materialized view and click Properties.

  4. Click the General tab and select or clear Used In Optimization, as appropriate.

  5. Click OK.

Results

When a materialized view is enabled for use by the optimizer, the optimizer will consider it when calculating the best plan for satisfying a query, even though the view is not explicitly referenced in the query. If a materialized view is disabled for use by the optimizer, the optimizer will not consider the view.

Next

You may want to query the underlying objects of the view to see if the optimizer makes use of the view by looking at the query execution plan. However, the availability of the view does not guarantee the optimizer will use it. The optimizer's choice is based on performance.

 See also