The process of selecting the Optimize Schema option is about as straightforward as it gets. The ease with which the option can be applied is a major enticement to its use, for anyone wishing to enhance cube processing performance quickly, and with minimal effort. Let's take the plunge, and then study the results by returning to the settings we have just examined.
1. Click Tools in the main menu of the Cube Editor.
2. Click Optimize Schema from the menu that appears, as shown in Illustration 12.
The Cube Schema Optimization message box appears, as depicted in Illustration 13.
We can ascertain, through the information provided on the Cube Schema Optimization message box, that the Member Key Column properties for the Store, Warehouse and Product dimensions have been optimized. The initial settings, which the original developer pointed to the keys in the respective dimension tables, have now been redirected to their (identical) counterparts in the fact table, inventory_fact_1997.
We also note the statement that the Time dimension cannot be optimized through the mechanism of the option. This is because of the disparity between the Time key column identifiers shared in the join between the Time dimension table and the fact table, and the Member Key Column property for the lowest-level Time dimension member, Month, which we mentioned earlier.
We are also informed that private and virtual dimensions cannot be subjected to the optimization process. This behavior is consistent with the set of requirements that MSAS imposes on dimensions that are candidates for the Optimize Schema option, as we learned in the Overview and Discussion section above.
3. Click OK to close the Cube Schema Optimization message box.
We will take a look at the Member Key Column property settings once again, and see the physical changes are as expected in our copy of the Warehouse cube. To do this from our current position within the Cube Editor, we will take the following steps:
1. Expand the Dimensions folder, as required, in the Tree pane, by clicking the "+" sign to its left, if necessary.
2. Expand the Store dimension in the Tree pane, if required.
3. Click the lowest level in the hierarchy, the Store Name level, as we did in our earlier examination of the associated Member Key Column property.
4. With the Basic tab selected in the Properties pane, below the Tree pane, examine the Member Key Column property setting, as shown in Illustration 14.
Illustration 14: Member Key Column Property - Basic Tab of Store Dimension Property Pane
We note that the Member Key Column is tied to the store_id column of the inventory_fact_1997 table, just as we might have expected. We can also examine the Member Key Column property for the lowest levels of the Warehouse and Product dimensions, Warehouse Name and Product Name, respectively, to see that an identical modification has occurred: each is pointed to the column in the inventory_fact_1997 table that corresponds to the column (from the respective dimension table) that occupied it before we selected Optimize Schema (warehouse_id and product_id, respectively). An examination of the same property in the Time dimension, of course, makes it clear that no modification in the Member Key Column property has occurred, as we have discussed above.
To summarize the process we have witnessed within our practice cube, when we selected the Optimize Schema option, each dimension was evaluated to determine its compliance with the conditions for optimization. For each of the dimensions that met the required conditions, the Member Key Column property of the lowest level of the dimension was changed to reference the foreign key in the fact table, instead of the key in the dimension table to which it had previously referred. Going forward, the new reference directs MSAS to use the key from the fact table during processing, instead of issuing queries that join the dimension to the fact table in the relational database. The removal of joins results in reduced processing time. In many cases, the Optimize Schema option alone can enhance the cube processing cycle significantly.
In this article, we examined the use of the Optimize Schema option within the Cube Editor, as a means of making our cubes process faster. As in the other articles of this series, after introducing our topic, we described a scenario whereby we were called upon to meet the business needs of a hypothetical client. We then prepared for our practice exercise by creating and processing a copy of the Warehouse sample cube.
We next discussed the Member Key Column property of our cube, and examined the existing, pre-optimized settings within our practice cube. Moreover, we relayed important considerations to ponder in determining the appropriateness of our use of the Optimize Schema option in our respective business environments. We instituted the Optimize Schema option within the Cube Editor, and noted the information that MSAS provided via the resulting message box, informing us of the modifications that it had made in the Member Key Column property of the applicable dimensions. Finally, we examined and discussed the immediate effects of the Optimize Schema option within the structure of our cube.
» See All Articles by Columnist William E. Pearson, III
Discuss this article in the MSSQL Server 2000 Analysis Services and MDX Topics Forum.