Database Reference
In-Depth Information
To do this in SQL Management Studio, open up a new XMLA query window and
enter the following:
<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/
engine">
<ClearCache>
<Object>
<DatabaseID>Adventure Works DW 2012</DatabaseID>
</Object>
</ClearCache>
</Batch>
Remember that the ID of a database may not be the same as its name—you can check
this by right-clicking on a database in the SQL Management Studio Object Explorer
and selecting Properties . Alternatives to this method also exist: the MDX Studio tool
allows you to clear the cache with a menu option, and the Analysis Services Stored
Procedure Project ( http://tinyurl.com/asstoredproc ) contains code that allows
you to clear the Analysis Services cache and the Windows File System cache directly
from MDX. Clearing the Windows File System cache is interesting because it allows
you to compare the performance of the cube on a warm and cold file system cache as
well as a warm and cold Analysis Services cache. When the Analysis Services cache
is cold or can't be used for some reason, a warm file system cache can still have a
positive impact on query performance.
After the cache has been cleared, before Analysis Services can answer a query it
needs to recreate the calculated members, named sets, and other objects defined in
a cube's MDX Script. If you have any reasonably complex named set expressions
that need to be evaluated, you'll see some activity in Profiler relating to these sets
being built and it's important to be able to distinguish between this and activity that's
related to the queries you're actually running. All MDX Script related activity occurs
between Execute MDX Script Begin and Execute MDX Script End events; these are
fired after the Query Begin event but before the Query Cube Begin event for the
query run after the cache has been cleared and there is one pair of Begin/End events
for each command on the MDX Script. When looking at a Profiler trace you should
either ignore everything between the first Execute MDX Script Begin event and
the last Execute MDX Script End event or run a query that returns no data at all to
trigger the evaluation of the MDX Script, for example:
SELECT {} ON 0
FROM [Adventure Works]
 
Search WWH ::




Custom Search