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

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - SQL Usage » Tables, views, and indexes » Materialized views


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.


You must be the owner, or have the ALTER ANY MATERIALIZED VIEW or ALTER ANY OBJECT system privilege.

  1. In Sybase Central, use the SQL Anywhere 16 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.


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 does not consider the view.


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 uses it. The optimizer's choice is based on performance.

 See also