ER/Studio - Embarcadero Technologies Product Documentation

ER/Studio - Embarcadero Technologies Product Documentation ER/Studio - Embarcadero Technologies Product Documentation

docs.embarcadero.com
from docs.embarcadero.com More from this publisher
24.12.2012 Views

USING ER/STUDIO > DEVELOPING THE PHYSICAL MODEL Permissions tab Sets access roles and user permissions for the package. Keep in mind that the more specific permissions are, the more time you may have to spend maintaining and updating them. The Roles and Users must be previously assigned to appear in the Package Editor. For more information, see Creating and Editing Database Roles and Creating and Editing Database Users. Creating and Editing Materialized Query Tables A materialized query table is a table that, like a materialized view, is defined based upon the result of a query addressing one or more tables. While the query on which a view is based is run whenever the view is referenced, a materialized query table stores the query results as data that you can work with instead of the data that is in the underlying tables. Materialized query tables can significantly improve query performance, especially for complex queries. The following database platforms support Materialized Query Tables: • IBM DB2 for LUW 5.x, 6.x, 7.x, 8.x, and 9.x NOTE: The DB2 Materialized Query Table Wizard and DB2 Materialized Query Table Editor share the same options, except for Attachment Bindings options which are present only in the editor. Add a Materialized Query Table 1 In the Data Model Explorer, expand the Physical Main Model, right-click the Materialized Query Table node, and then click New Materialized Query Table. 2 Complete the DB2 Materialized Query Table Wizard and then click Finish to create the materialized query table. TIP: Once you have created the materialized query table, you can edit it by right-clicking the materialized query table you want to change, and then clicking Edit Materialized Query Table. The following describe options that require additional explanation. Name page/tab The name of the materialized query table is derived from the information entered here, in the format of owner.name where: • owner is the owner of the materialized query table. • name is the name of the materialized query table. Location page/tab • What is the table tablespace: To avoid the performance overhead created by logging changes to the data, create materialized query tables in a table space that is defined as NOT LOGGED. • Refresh Preferences: Determines when the materialized query table is update when its base tables are updated. • Query Optimization: If enabled, DB2 can consider the materialized query table in automatic query rewrite. When query optimization is enabled, DB2 is more restrictive of what can be selected in the full select for a materialized query table. SQL page/tab Enter the entire select statement for the materialized view, starting with the keyword SELECT. EMBARCADERO TECHNOLOGIES > ER/STUDIO® 8.0.3 USER GUIDE 194

USING ER/STUDIO > DEVELOPING THE PHYSICAL MODEL Definition page/tab Enter or edit a definition or description for the materialized view. If the target database supports it, ER/Studio adds this definition as a comment when generating SQL code. DDL page/tab Displays the CREATE SUMMARY TABLE AS ... (SELECT ...) statement needed to build the node group. ER/Studio uses the platform-specific parser of the model’s selected database platform to generate the materialized query table. Attachment Bindings tab Bind an external piece of information, or attachment to the materialized query table. You can also remove an attachment from an object, override an attachment binding’s default value, or change the position of a bound attachment. To override the value of the attachment you have moved to the Selected Attachments grid, double-click the Value field of the target attachment. ER/Studio opens the Value Override Editor or a list depending on the attachment datatype. Attachments are created in the Attachments folder of the Data Dictionary. For more information, see Attaching External Documents to the Data Model. Notes • The materialized query table is not populated when first created. You must explicitly populate the materialized query table using the REFRESH TABLE statement for system-maintained materialized query tables or by using the LOAD utility, INSERT statement or the REFRESH TABLE statement for user-maintained materialized query tables. Creating and Editing Materialized Views The performance of data warehousing and decision support system tools can be significantly increased when materialized views are used. Materialized views increase the speed of queries that access many records, allowing you to query terabytes of data in seconds. A materialized view is a pre-computed table comprising aggregated or joined data from fact and possibly dimension tables which is also known as a summary or aggregate table. An example of such a pre-defined query would be the sum of sales by region for a specific period of time. The storage requirements of the pre-computed summarizations and data joins of a materialized view are small compared to the original source data. A materialized view creates a real table that can be indexed and analyzed. The following database platforms support materialized views: • Oracle 8.x, 9i, 10g, and 11g NOTE: The Oracle Materialized View Wizard and Oracle Materialized View Editor share the same options, except for PreSQL & PostSQL, Permissions, and Attachment Bindings options which are available only in the editor. Create a Materialized View 1 In the Data Model Explorer, expand the Physical Main Model, right-click the Materialized Views node, and then click New Materialized View. 2 Complete the Oracle Materialized View Wizard and then click Finish to create the materialized view. TIP: Once you have created the materialized view, you can edit it by right-clicking the materialized view you want to change, and then clicking Edit Materialized View. The following describe options that require additional explanation. EMBARCADERO TECHNOLOGIES > ER/STUDIO® 8.0.3 USER GUIDE 195

USING <strong>ER</strong>/STUDIO > DEVELOPING THE PHYSICAL MODEL<br />

Permissions tab<br />

Sets access roles and user permissions for the package. Keep in mind that the more specific permissions are,<br />

the more time you may have to spend maintaining and updating them. The Roles and Users must be previously<br />

assigned to appear in the Package Editor. For more information, see Creating and Editing Database Roles and<br />

Creating and Editing Database Users.<br />

Creating and Editing Materialized Query Tables<br />

A materialized query table is a table that, like a materialized view, is defined based upon the result of a query<br />

addressing one or more tables. While the query on which a view is based is run whenever the view is referenced, a<br />

materialized query table stores the query results as data that you can work with instead of the data that is in the<br />

underlying tables.<br />

Materialized query tables can significantly improve query performance, especially for complex queries.<br />

The following database platforms support Materialized Query Tables:<br />

• IBM DB2 for LUW 5.x, 6.x, 7.x, 8.x, and 9.x<br />

NOTE: The DB2 Materialized Query Table Wizard and DB2 Materialized Query Table Editor share the<br />

same options, except for Attachment Bindings options which are present only in the editor.<br />

Add a Materialized Query Table<br />

1 In the Data Model Explorer, expand the Physical Main Model, right-click the Materialized Query Table node,<br />

and then click New Materialized Query Table.<br />

2 Complete the DB2 Materialized Query Table Wizard and then click Finish to create the materialized query<br />

table.<br />

TIP: Once you have created the materialized query table, you can edit it by right-clicking the<br />

materialized query table you want to change, and then clicking Edit Materialized Query Table.<br />

The following describe options that require additional explanation.<br />

Name page/tab<br />

The name of the materialized query table is derived from the information entered here, in the format of<br />

owner.name where:<br />

• owner is the owner of the materialized query table.<br />

• name is the name of the materialized query table.<br />

Location page/tab<br />

• What is the table tablespace: To avoid the performance overhead created by logging changes to the data,<br />

create materialized query tables in a table space that is defined as NOT LOGGED.<br />

• Refresh Preferences: Determines when the materialized query table is update when its base tables are<br />

updated.<br />

• Query Optimization: If enabled, DB2 can consider the materialized query table in automatic query rewrite. When<br />

query optimization is enabled, DB2 is more restrictive of what can be selected in the full select for a materialized<br />

query table.<br />

SQL page/tab<br />

Enter the entire select statement for the materialized view, starting with the keyword SELECT.<br />

EMBARCAD<strong>ER</strong>O TECHNOLOGIES > <strong>ER</strong>/STUDIO® 8.0.3 US<strong>ER</strong> GUIDE 194

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!