Site sponsored by: Idera Try Idera’s new SQL admin toolset
SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


Article Topics

All Articles
Peformance Tuning
Audit
Business Intelligence
Clustering
Reporting Services
Developer
General DBA
ASP.NET / ADO.NET

SQL Server 2008 - Worth the Wait

SQL Server’s first significant upgrade in three years features a number of envelope-pushing enhancements and improvements. Which will have the greatest impact on SQL administration and development? More...
Latest Articles

Slowly Changing Dimensions in SQL Server 2005
Audit Data Modifications
SQL Server 2008’s Management Data Warehouse
Same Report but Different Methods in SQL Server Reporting Services ...

More     
 
Latest FAQ's

SSIS Lookups are Case Sensitive
Convert Number to Words in SSRS
After installing SP2 on SQL Server 2005 x64, when trying to ...
Remote Name Could not be Resolved in SQL Server Reporting Services ...

More     
   
Latest Software Reviews

SQL Server DBA Dashboard
SwisSQL DBChangeManager
SQLMesh - SQL Server Search Tool
SoftTreeTech SQL Assistant

More     

articles >> business intelligence >> Optimizing Microsoft SQL Server Analysis Services: MDX ...

Optimizing Microsoft SQL Server Analysis Services: MDX Optimization Techniques: Caching and Additional Techniques

By : William E. Pearson, III
Apr 18, 2004
Printer friendly

Introduction and Scope


In this article, we will continue our examination of MDX optimization techniques, begun in the article prior to the last, MDX Optimization Techniques: Introduction and the Role of Processing, and continued in the last article, MDX Optimization Techniques: Further Control of Processing Location and Expression Arrangement. In both articles, we focused upon control of location as a primary type of tuning interaction for MDX query optimization. We performed practice exercises to reinforce the concepts exposed, and then extended our considerations of additional tuning interaction types to include the optimization of set operations and syntax arrangement considerations. Within our exploration of the optimization of set operations, we undertook practice examples that illustrated some ways (additional tuning interaction types) whereby we can rearrange queries to enhance performance, often significantly.


In this article, we will expose methods of caching to load a commonly used slice of a cube into memory, for faster retrieval in prospective operations. Our discussion of caching as another tuning interaction type will include various aspects of cache creation, and uses of caching within MDX. In addition, we will touch upon other performance enhancement options, including external functions and cube design modifications and augmentation.

Optimizing Performance Through Caching


When queries are not well underpinned by aggregates, processing suffers. Extra effort has to be expended to compensate for the missing accumulations. We can often enhance performance by creating and caching the appropriate aggregates in memory. Caching is a feature that MDX provides to improve performance; caching affords us the capability of loading a commonly used slice of a cube into memory, “caching” it for faster retrieval by our queries.


Analysis Services and the PivotTable Service automatically cache query definitions, data, and meta data on the server and client sides, respectively. Caching increases performance in those cases where queries are repeatedly requesting the same data or meta data, reducing network traffic or execution time. The ability to create caches for data that we specify in MDX gives us another means of fine-tuning query performance; through this capability we realize a great degree of control over the caching of data for which we expect there to be a recurring need.
 

In terms of creation scope, caches are analogous to named sets: we can create a cache for the lifetime of a single query, or limit its life to a session. To create a cache to be used at the session level, the CREATE CACHE statement can be used. The CREATE CACHE statement can be used to create caches at the query level, but the WITH statement, with which we are now somewhat familiar, can perform this task just as easily, and is more frequently used for this purpose.
 

Let’s take a look at the use of the WITH statement to create a cache in an MDX query. First, we’ll call the MDX Sample Application, with which we have become familiar in previous articles, as a platform from which to perform our practice exercises.
 

1. Start the MDX Sample Application.
 

We are initially greeted by the Connect dialog, shown in Figure 1.
 


 

Figure 1: The Connect Dialog for the MDX Sample Application
 

The illustration above depicts the name of my server, MOTHER1, and properly indicates that we will be connecting via the MSOLAP provider (the default).
 

2. Click OK.
 

The MDX Sample Application window appears.
 

3. Clear the top area (the Query pane) of any remnants of queries that might appear.
 

4. Ensure that FoodMart 2000 is selected as the database name in the DB box of the toolbar.
 

5. Select the Warehouse cube in the Cube drop-down list box.
 

The MDX Sample Application window should resemble that depicted in Figure 2, complete with the information from the Warehouse cube displaying in the Metadata tree (left section of the Metadata pane).
 


 

Figure 2: The MDX Sample Application Window (Compressed View)
 


    Next Page>>    








Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | QDPMA Performance Tuning | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views