Creating a Materialized View

Define a SQL query, using the Create Materialized View wizard, to create a new materialized view in the system store (IQ catalog store).

Prerequisites
Database Version Materialized View Privileges
SAP Sybase IQ 15.3 and 15.4

Materialized view to be owned by self – you must have RESOURCE authority with SELECT permission on tables in the view definition. You must also have CREATE permission on the selected dbspace to create a view owned by you.

Materialized view to be owned by any user – you must have DBA authority.

SAP Sybase IQ 16.0 Materialized view to be owned by self – you must have CREATE MATERIALIZED VIEW system privilege. You must also have one of:
  • CREATE ANY OBJECT system privilege
  • CREATE object permission on the dbspace where the materialized view is being created
Finally, you must have one of:
  • SELECT ANY TABLE system privilege
  • SELECT object permission on the underlying tables of the materialized view

Materialized view to be owned by any user – you must have CREATE object permission on the dbspace where the materialized view is being created. You must also have one of:

  • CREATE ANY MATERIALIZED VIEW system privilege
  • CREATE ANY OBJECT system privilege
Finally, you must have one of:
  • SELECT ANY TABLE system privilege
  • SELECT object permission on the underlying tables of the materialized view
Task
Materialized views are only supported for system store (IQ catalog store) tables.
  1. In the Perspective Resources view, select the resource, and select Resource > Administration Console.
  2. In the left pane, expand IQ Servers > Schema Objects > Views, and then select Materialized Views.
  3. Click the arrow next to Materialized Views and select New.
    The Create Materialized View Wizard appears.
  4. On the Welcome page, specify
    Option Description
    Select a resource for which the materialized view will be created From the list, select the resource for which the materialized view will be created.
    Which user or group do you want to own the materialized view? From the list, select the user or role/group to own the materialized view.
    What do you want to name the materialized view? Enter a unique name for the new materialized view; maximum of 128 characters.
    Comment Specify a comment for the materialized view.
  5. Click Next.
  6. On the SQL page, define a SELECT statement for the materialized view. Click Next.
  7. On the Dbspace page, specify the dbspace that will be used to store the materialized view. Click Next.
  8. On the Free Space page, specify the amount of free space you want to reserve for each materialized view page. Click Next.
  9. On the Options page, specify:
    Option Description
    Enable this materialized view Select option to enable.
    Enable use of this materialized view in optimization Select option to enable.
  10. Click Finish.
Related concepts
Materialized View Permissions
Materialized View Indexes
Related tasks
Viewing Materialized View Data in the Execute SQL Window
Refreshing Materialized View Data
Truncating Materialized View Data
Validating Materialized View Data
Setting a Clustered Index
Recompiling and Enabling a Materialized View
Disabling a Materialized View
Deleting a Materialized View
Generating Materialized View DDL Commands
Viewing or Modifying Materialized View Properties
Authenticating a Login Account for a Managed Resource
Related reference
Materialized View Privilege Summary