Clearing the SQL Server Analysis Services Cache


Preparing to do some MDX performance testing?  Step one for each and every test should be to clear the cache.  This will ensure you are seeing the performance results without the benefit of having data already loaded up in memory.  How do you empty the MS SQL Analysis Services cache prior to running your query?  Execute the following XML in a SQL Server Management Studio window:

<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
     <ClearCache>
          <Object>
               <DatabaseID>Your Database Goes here </DatabaseID>
          </Object>
     </ClearCache>
</Batch>

Thanks to Dustin Ryan at bidn.com for this tip!


Leave a Reply

Your email address will not be published.