SlideShare a Scribd company logo
Agenda
• How Analysis Services caching works
• When and why Analysis Services can’t cache
data
• Warming the Storage Engine cache with the
CREATE CACHE statement
• Warming the Formula Engine cache by
running queries
• Automating cache warming
How Analysis Services answers queries
Formula Engine
works out what data is
needed for each query,
and requests it from the
Storage Engine
Storage Engine
handles retrieval of
raw data from disk,
and any aggregation
required
MDX Query In Cellset Out
Query Subcube
Requests
Cache
Cache
Disk
Types of Analysis Services cache
• Analysis Services can therefore cache two types of value:
– Values returned by the Storage Engine
• ‘Raw’ measure values, one cache per measure group
• Dimension data, one cache per dimension
– Values returned by the Formula Engine
• Numeric values only – strings can’t be cached
• All SE caches have the same structure, known as the data
cache registry
• The FE can also store values in this structure if calculations
are evaluated in bulk mode
• The FE uses a different structure, the flat cache, for
calculations evaluated in cell-by-cell mode
Storage Engine Cache
• Data in the data cache registry is held in subcubes, ie
data at a common granularity
• Subcubes may not contain an entire granularity – they
may be filtered
• SE cache data can be aggregated to answer queries
– Except when the measure data itself cannot be
aggregated, for example with distinct count measures or
many-to-many
• Sometimes more data is fetched into cache than is
necessary for the query – this is known as ‘prefetching’
– Usually good for performance, but can cause problems
• Arbitrary-shaped subcubes cannot be cached
Formula Engine Cache Scopes
• There are three different ‘scopes’ or lifetimes of a FE cache:
– Query – for calculations defined in the WITH clause of a query,
the FE values can only be cached for the lifetime of the query
– Session – for calculations defined for a session, using the
CREATE MEMBER statement executed on the client, FE values
can only be cached for the lifetime of a session
– Global – for calculations defined in the cube’s MDX Script, FE
values can be cached until either
• Any kind of cube processing takes place
• A ClearCache XMLA command is executed
• Writeback is committed
• Global scope is best from a performance point of view!
Cache Sharing
• Values stored in the SE cache can always be shared
between all users
• Values stored in the FE cache can be shared between
users, except when:
– Stored in Query or Session-scoped caches
– Users belong to roles with different dimensions security
permissions
• Note: dynamic security always prevents cache sharing
• Calculations evaluated in bulk mode cannot reference
values stored in the FE flat cache
• Calculations evaluated in cell-by-cell mode cannot
reference values stored in the FE data cache registry
Forcing Query-scoping
• In certain circumstances, SSAS uses query-scoped FE
caches when you would expect it to use global scope
• These are:
– Calculations that use the Username or LookupCube
functions
– Calculations use non-deterministic functions such as Now()
or any SSAS stored procedures
– Queries that use subselects
– When any calculated member is defined in the WITH
clause, whether it is referenced or not in the query
– When cell security is used
Warming the SE cache
• Considerations for warming the SE cache:
– We want to avoid cache fragmentation, for example having
one unfiltered subcube cached rather than multiple
filtered subcubes
– It is possible to overfill the cache – the SE will stop looking
in the cache after it has searched 1000 subcubes
– We want to cache lower rather than higher granularities,
since the latter can be aggregated from the former in
memory
– We need a way of working out which granularities are
useful
Warming the SE cache
• We can warm the SE cache by using either:
– WITH CACHE, to warm the cache for a single query – not
very useful
– The CREATE CACHE command
• Remember that building aggregations is often a better
alternative to warming the SE cache
• But in some cases you can’t build aggregations – for example
when there are many-to-many relationships
CREATE CACHE
• Example CREATE CACHE statement:
CREATE CACHE
FOR [Adventure Works] AS
'({[Measures].[Internet Sales Amount]},
{[Date].[Date].[Date].MEMBERS},
{[Product].[Category].[Category].MEMBERS})'
Which subcubes should I cache?
• The Query Subcube and Query Subcube Verbose
events in Profiler show the subcubes requested
from the SE by the FE
• This is also the information stored in the SSAS
query log, stored in SQL Server
• Analyse this data manually and find the most
commonly-requested, lower-granularity subcubes
• Maybe also query the Query Log, or a Profiler
trace saved to SQL Server, to find other subcubes
– perhaps for queries that have been run recently
Warming the FE cache
• First, tune your calculations! Ensure use of bulk mode
where possible
• The only way to warm the FE cache is to run MDX
queries containing calculations
• Remember, these queries must not:
– Include a WITH clause
– Subselects
• Also, no point trying to cache calculations whose
values cannot be cached
• And think about how security can impact cache usage
Queries to warm the FE Cache
• Again, it is worth manually constructing some MDX queries yourself to
warm the FE cache
• Also, running regularly-used queries (for example those used in SSRS
reports) can be a good idea
• Can easily collect the queries your users are running by running a
Profiler trace, then saving that trace to SQL Server or a .trc file
– The Query Begin and Query End events contain the MDX query
– Need to filter out those with a WITH clause etc
– Watch out for parameterisation (eg SSRS)
– Watch out for use of session sets and calculations (eg Excel 2003)
– Watch out for queries that slice by Time, where the actual slicer
used may change regularly
– Think about the impact of dimension security too
Memory considerations
• SSAS caching can use a lot of memory!
• The cache will keep growing until SSAS thinks it is running
out of memory:
– When memory usage exceeds the % of available system
memory specified in the LowMemoryLimit property, data will be
dropped from cache
– When it exceeds the % specified in the TotalMemoryLimit
property, all data will be dropped from cache
– We therefore don’t want to exceed the LowMemoryLimit
– We also want to avoid paging
– We need to leave space for caching real user queries
• The FE flat cache is limited to 10% of the TotalMemoryLimit
– If it grows bigger than that, it is completely emptied
Automating Cache Warming
• We should perform cache-warming after cube
processing has taken place
• Remember – it may take a long time! It should not
overlap/interfere with real users querying
• We can automate it a number of different ways:
– Running SSRS reports on a data-driven subscription
– Using the ascmd.exe utility
– Building your own SSIS package – the best solution for
overall flexibility.
• Either fetch queries from a SQL Server table
• Or from a Profiler .trc file using the Konesans Trace File Source
component
Summary
• Clearly a lot of problems to watch out for!
• However, some cache-warming (however
inefficient) is often better than none at all
• A perfectly-tuned cube would have little need for
cache-warming, but...
– Some performance problems we just don’t know
about
– Some we may not be able to fix (eg with complex
calculations, hardware limitations)
– Cache warming is likely to have some positive impact
in these cases – maybe lots, maybe not much
Thank you…

More Related Content

What's hot

Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparison
Rohit Kelapure
 
MySQL Replication Basics
MySQL Replication BasicsMySQL Replication Basics
MySQL Replication Basics
Abdul Manaf
 
Explicit Dedication of Resources in CloudStack
Explicit Dedication of Resources in CloudStackExplicit Dedication of Resources in CloudStack
Explicit Dedication of Resources in CloudStack
Saksham Srivastava
 
Eh cache in Kaunas JUG
Eh cache in Kaunas JUGEh cache in Kaunas JUG
Eh cache in Kaunas JUG
Kaunas Java User Group
 
Analysis of mysql and postgresql
Analysis of mysql and postgresqlAnalysis of mysql and postgresql
Analysis of mysql and postgresql
Asif Anik
 
Dynamicly Scale Weblogic in the private Cloud clusters
Dynamicly Scale Weblogic in the private Cloud clusters   Dynamicly Scale Weblogic in the private Cloud clusters
Dynamicly Scale Weblogic in the private Cloud clusters
Getting value from IoT, Integration and Data Analytics
 
MySQL Architecture and Engine
MySQL Architecture and EngineMySQL Architecture and Engine
MySQL Architecture and Engine
Abdul Manaf
 
11g r2 flashcache_Tips
11g r2 flashcache_Tips11g r2 flashcache_Tips
11g r2 flashcache_Tips
Louis liu
 
MySQL Performance Secrets
MySQL Performance SecretsMySQL Performance Secrets
MySQL Performance Secrets
OSSCube
 
Oracle database smart flash cache
Oracle database smart flash cacheOracle database smart flash cache
Oracle database smart flash cache
Johan Louwers
 
How to fix IO problems for faster SQL Server performance
How to fix IO problems for faster SQL Server performanceHow to fix IO problems for faster SQL Server performance
How to fix IO problems for faster SQL Server performance
SolarWinds
 

What's hot (11)

Caching technology comparison
Caching technology comparisonCaching technology comparison
Caching technology comparison
 
MySQL Replication Basics
MySQL Replication BasicsMySQL Replication Basics
MySQL Replication Basics
 
Explicit Dedication of Resources in CloudStack
Explicit Dedication of Resources in CloudStackExplicit Dedication of Resources in CloudStack
Explicit Dedication of Resources in CloudStack
 
Eh cache in Kaunas JUG
Eh cache in Kaunas JUGEh cache in Kaunas JUG
Eh cache in Kaunas JUG
 
Analysis of mysql and postgresql
Analysis of mysql and postgresqlAnalysis of mysql and postgresql
Analysis of mysql and postgresql
 
Dynamicly Scale Weblogic in the private Cloud clusters
Dynamicly Scale Weblogic in the private Cloud clusters   Dynamicly Scale Weblogic in the private Cloud clusters
Dynamicly Scale Weblogic in the private Cloud clusters
 
MySQL Architecture and Engine
MySQL Architecture and EngineMySQL Architecture and Engine
MySQL Architecture and Engine
 
11g r2 flashcache_Tips
11g r2 flashcache_Tips11g r2 flashcache_Tips
11g r2 flashcache_Tips
 
MySQL Performance Secrets
MySQL Performance SecretsMySQL Performance Secrets
MySQL Performance Secrets
 
Oracle database smart flash cache
Oracle database smart flash cacheOracle database smart flash cache
Oracle database smart flash cache
 
How to fix IO problems for faster SQL Server performance
How to fix IO problems for faster SQL Server performanceHow to fix IO problems for faster SQL Server performance
How to fix IO problems for faster SQL Server performance
 

Viewers also liked

Abstraction file
Abstraction fileAbstraction file
Abstraction file
Tony Nguyen
 
Inheritance
InheritanceInheritance
Inheritance
Tony Nguyen
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
Harry Potter
 
Api crash
Api crashApi crash
Api crash
Fraboni Ec
 
How analysis services caching works
How analysis services caching worksHow analysis services caching works
How analysis services caching works
Harry Potter
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
Harry Potter
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
Tony Nguyen
 
Extending burp with python
Extending burp with pythonExtending burp with python
Extending burp with python
Harry Potter
 
Business analytics and data mining
Business analytics and data miningBusiness analytics and data mining
Business analytics and data mining
Tony Nguyen
 
Poo java
Poo javaPoo java
Poo java
Harry Potter
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
Luis Goldster
 
Optimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsOptimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessors
Tony Nguyen
 
Cache recap
Cache recapCache recap
Cache recap
Harry Potter
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
Tony Nguyen
 
Big picture of data mining
Big picture of data miningBig picture of data mining
Big picture of data mining
Luis Goldster
 
Object oriented programming-with_java
Object oriented programming-with_javaObject oriented programming-with_java
Object oriented programming-with_java
Harry Potter
 
Inheritance
InheritanceInheritance
Inheritance
Harry Potter
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Luis Goldster
 
Python basics
Python basicsPython basics
Python basics
Luis Goldster
 
Python language data types
Python language data typesPython language data types
Python language data types
Fraboni Ec
 

Viewers also liked (20)

Abstraction file
Abstraction fileAbstraction file
Abstraction file
 
Inheritance
InheritanceInheritance
Inheritance
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
 
Api crash
Api crashApi crash
Api crash
 
How analysis services caching works
How analysis services caching worksHow analysis services caching works
How analysis services caching works
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
Python your new best friend
Python your new best friendPython your new best friend
Python your new best friend
 
Extending burp with python
Extending burp with pythonExtending burp with python
Extending burp with python
 
Business analytics and data mining
Business analytics and data miningBusiness analytics and data mining
Business analytics and data mining
 
Poo java
Poo javaPoo java
Poo java
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Optimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsOptimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessors
 
Cache recap
Cache recapCache recap
Cache recap
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
Big picture of data mining
Big picture of data miningBig picture of data mining
Big picture of data mining
 
Object oriented programming-with_java
Object oriented programming-with_javaObject oriented programming-with_java
Object oriented programming-with_java
 
Inheritance
InheritanceInheritance
Inheritance
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Python basics
Python basicsPython basics
Python basics
 
Python language data types
Python language data typesPython language data types
Python language data types
 

Similar to How analysis services caching works

Extreme SSAS - Part II
Extreme SSAS - Part IIExtreme SSAS - Part II
Extreme SSAS - Part II
Itay Braun
 
SQLDay2013_MarcinSzeliga_StoredProcedures
SQLDay2013_MarcinSzeliga_StoredProceduresSQLDay2013_MarcinSzeliga_StoredProcedures
SQLDay2013_MarcinSzeliga_StoredProcedures
Polish SQL Server User Group
 
[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions
ITviec
 
Using Query Store to Understand and Control Query Performance
Using Query Store to Understand and Control Query PerformanceUsing Query Store to Understand and Control Query Performance
Using Query Store to Understand and Control Query Performance
Grant Fritchey
 
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL ServerGeek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
IDERA Software
 
Twitter Fatcache
Twitter FatcacheTwitter Fatcache
Twitter Fatcache
its_skm
 
Investigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock HolmesInvestigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock Holmes
Richard Douglas
 
Selecting the right cache framework
Selecting the right cache frameworkSelecting the right cache framework
Selecting the right cache framework
Mohammed Fazuluddin
 
01 oracle architecture
01 oracle architecture01 oracle architecture
01 oracle architecture
Smitha Padmanabhan
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
WordCamp Cape Town
 
SQL 2014 In-Memory OLTP
SQL 2014 In-Memory  OLTPSQL 2014 In-Memory  OLTP
SQL 2014 In-Memory OLTP
Amber Keyse
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019
Antonios Chatzipavlis
 
SQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should KnowSQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should Know
Dean Richards
 
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Migrating Customers to Microsoft Azure: Lessons Learned From the FieldMigrating Customers to Microsoft Azure: Lessons Learned From the Field
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Ido Flatow
 
The Impala Cookbook
The Impala CookbookThe Impala Cookbook
The Impala Cookbook
Cloudera, Inc.
 
Where Django Caching Bust at the Seams
Where Django Caching Bust at the SeamsWhere Django Caching Bust at the Seams
Where Django Caching Bust at the Seams
Concentric Sky
 
7 ways for data teams to save money in azure
7 ways for data teams to save money in azure7 ways for data teams to save money in azure
7 ways for data teams to save money in azure
John McCormack
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability Considerations
Navid Malek
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
Betclic Everest Group Tech Team
 
20345-1B_02.pptx
20345-1B_02.pptx20345-1B_02.pptx
20345-1B_02.pptx
AanSulistiyo
 

Similar to How analysis services caching works (20)

Extreme SSAS - Part II
Extreme SSAS - Part IIExtreme SSAS - Part II
Extreme SSAS - Part II
 
SQLDay2013_MarcinSzeliga_StoredProcedures
SQLDay2013_MarcinSzeliga_StoredProceduresSQLDay2013_MarcinSzeliga_StoredProcedures
SQLDay2013_MarcinSzeliga_StoredProcedures
 
[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions
 
Using Query Store to Understand and Control Query Performance
Using Query Store to Understand and Control Query PerformanceUsing Query Store to Understand and Control Query Performance
Using Query Store to Understand and Control Query Performance
 
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL ServerGeek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
Geek Sync I Need for Speed: In-Memory Databases in Oracle and SQL Server
 
Twitter Fatcache
Twitter FatcacheTwitter Fatcache
Twitter Fatcache
 
Investigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock HolmesInvestigate SQL Server Memory Like Sherlock Holmes
Investigate SQL Server Memory Like Sherlock Holmes
 
Selecting the right cache framework
Selecting the right cache frameworkSelecting the right cache framework
Selecting the right cache framework
 
01 oracle architecture
01 oracle architecture01 oracle architecture
01 oracle architecture
 
Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!Anthony Somerset - Site Speed = Success!
Anthony Somerset - Site Speed = Success!
 
SQL 2014 In-Memory OLTP
SQL 2014 In-Memory  OLTPSQL 2014 In-Memory  OLTP
SQL 2014 In-Memory OLTP
 
Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019Modernizing your database with SQL Server 2019
Modernizing your database with SQL Server 2019
 
SQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should KnowSQL Server Wait Types Everyone Should Know
SQL Server Wait Types Everyone Should Know
 
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
Migrating Customers to Microsoft Azure: Lessons Learned From the FieldMigrating Customers to Microsoft Azure: Lessons Learned From the Field
Migrating Customers to Microsoft Azure: Lessons Learned From the Field
 
The Impala Cookbook
The Impala CookbookThe Impala Cookbook
The Impala Cookbook
 
Where Django Caching Bust at the Seams
Where Django Caching Bust at the SeamsWhere Django Caching Bust at the Seams
Where Django Caching Bust at the Seams
 
7 ways for data teams to save money in azure
7 ways for data teams to save money in azure7 ways for data teams to save money in azure
7 ways for data teams to save money in azure
 
Scalability Considerations
Scalability ConsiderationsScalability Considerations
Scalability Considerations
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
20345-1B_02.pptx
20345-1B_02.pptx20345-1B_02.pptx
20345-1B_02.pptx
 

More from Fraboni Ec

Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreading
Fraboni Ec
 
Lisp
LispLisp
What is simultaneous multithreading
What is simultaneous multithreadingWhat is simultaneous multithreading
What is simultaneous multithreading
Fraboni Ec
 
Directory based cache coherence
Directory based cache coherenceDirectory based cache coherence
Directory based cache coherence
Fraboni Ec
 
Business analytics and data mining
Business analytics and data miningBusiness analytics and data mining
Business analytics and data mining
Fraboni Ec
 
Big picture of data mining
Big picture of data miningBig picture of data mining
Big picture of data mining
Fraboni Ec
 
Data mining and knowledge discovery
Data mining and knowledge discoveryData mining and knowledge discovery
Data mining and knowledge discovery
Fraboni Ec
 
Cache recap
Cache recapCache recap
Cache recap
Fraboni Ec
 
Hardware managed cache
Hardware managed cacheHardware managed cache
Hardware managed cache
Fraboni Ec
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
Fraboni Ec
 
Cobol, lisp, and python
Cobol, lisp, and pythonCobol, lisp, and python
Cobol, lisp, and python
Fraboni Ec
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
Fraboni Ec
 
Optimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsOptimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessors
Fraboni Ec
 
Abstraction file
Abstraction fileAbstraction file
Abstraction file
Fraboni Ec
 
Object model
Object modelObject model
Object model
Fraboni Ec
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Fraboni Ec
 
Abstract class
Abstract classAbstract class
Abstract class
Fraboni Ec
 
Concurrency with java
Concurrency with javaConcurrency with java
Concurrency with java
Fraboni Ec
 
Inheritance
InheritanceInheritance
Inheritance
Fraboni Ec
 
Extending burp with python
Extending burp with pythonExtending burp with python
Extending burp with python
Fraboni Ec
 

More from Fraboni Ec (20)

Hardware multithreading
Hardware multithreadingHardware multithreading
Hardware multithreading
 
Lisp
LispLisp
Lisp
 
What is simultaneous multithreading
What is simultaneous multithreadingWhat is simultaneous multithreading
What is simultaneous multithreading
 
Directory based cache coherence
Directory based cache coherenceDirectory based cache coherence
Directory based cache coherence
 
Business analytics and data mining
Business analytics and data miningBusiness analytics and data mining
Business analytics and data mining
 
Big picture of data mining
Big picture of data miningBig picture of data mining
Big picture of data mining
 
Data mining and knowledge discovery
Data mining and knowledge discoveryData mining and knowledge discovery
Data mining and knowledge discovery
 
Cache recap
Cache recapCache recap
Cache recap
 
Hardware managed cache
Hardware managed cacheHardware managed cache
Hardware managed cache
 
Data structures and algorithms
Data structures and algorithmsData structures and algorithms
Data structures and algorithms
 
Cobol, lisp, and python
Cobol, lisp, and pythonCobol, lisp, and python
Cobol, lisp, and python
 
Abstract data types
Abstract data typesAbstract data types
Abstract data types
 
Optimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessorsOptimizing shared caches in chip multiprocessors
Optimizing shared caches in chip multiprocessors
 
Abstraction file
Abstraction fileAbstraction file
Abstraction file
 
Object model
Object modelObject model
Object model
 
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
 
Abstract class
Abstract classAbstract class
Abstract class
 
Concurrency with java
Concurrency with javaConcurrency with java
Concurrency with java
 
Inheritance
InheritanceInheritance
Inheritance
 
Extending burp with python
Extending burp with pythonExtending burp with python
Extending burp with python
 

Recently uploaded

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
FODUU
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 

Recently uploaded (20)

Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Things to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUUThings to Consider When Choosing a Website Developer for your Website | FODUU
Things to Consider When Choosing a Website Developer for your Website | FODUU
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 

How analysis services caching works

  • 1. Agenda • How Analysis Services caching works • When and why Analysis Services can’t cache data • Warming the Storage Engine cache with the CREATE CACHE statement • Warming the Formula Engine cache by running queries • Automating cache warming
  • 2. How Analysis Services answers queries Formula Engine works out what data is needed for each query, and requests it from the Storage Engine Storage Engine handles retrieval of raw data from disk, and any aggregation required MDX Query In Cellset Out Query Subcube Requests Cache Cache Disk
  • 3. Types of Analysis Services cache • Analysis Services can therefore cache two types of value: – Values returned by the Storage Engine • ‘Raw’ measure values, one cache per measure group • Dimension data, one cache per dimension – Values returned by the Formula Engine • Numeric values only – strings can’t be cached • All SE caches have the same structure, known as the data cache registry • The FE can also store values in this structure if calculations are evaluated in bulk mode • The FE uses a different structure, the flat cache, for calculations evaluated in cell-by-cell mode
  • 4. Storage Engine Cache • Data in the data cache registry is held in subcubes, ie data at a common granularity • Subcubes may not contain an entire granularity – they may be filtered • SE cache data can be aggregated to answer queries – Except when the measure data itself cannot be aggregated, for example with distinct count measures or many-to-many • Sometimes more data is fetched into cache than is necessary for the query – this is known as ‘prefetching’ – Usually good for performance, but can cause problems • Arbitrary-shaped subcubes cannot be cached
  • 5. Formula Engine Cache Scopes • There are three different ‘scopes’ or lifetimes of a FE cache: – Query – for calculations defined in the WITH clause of a query, the FE values can only be cached for the lifetime of the query – Session – for calculations defined for a session, using the CREATE MEMBER statement executed on the client, FE values can only be cached for the lifetime of a session – Global – for calculations defined in the cube’s MDX Script, FE values can be cached until either • Any kind of cube processing takes place • A ClearCache XMLA command is executed • Writeback is committed • Global scope is best from a performance point of view!
  • 6. Cache Sharing • Values stored in the SE cache can always be shared between all users • Values stored in the FE cache can be shared between users, except when: – Stored in Query or Session-scoped caches – Users belong to roles with different dimensions security permissions • Note: dynamic security always prevents cache sharing • Calculations evaluated in bulk mode cannot reference values stored in the FE flat cache • Calculations evaluated in cell-by-cell mode cannot reference values stored in the FE data cache registry
  • 7. Forcing Query-scoping • In certain circumstances, SSAS uses query-scoped FE caches when you would expect it to use global scope • These are: – Calculations that use the Username or LookupCube functions – Calculations use non-deterministic functions such as Now() or any SSAS stored procedures – Queries that use subselects – When any calculated member is defined in the WITH clause, whether it is referenced or not in the query – When cell security is used
  • 8. Warming the SE cache • Considerations for warming the SE cache: – We want to avoid cache fragmentation, for example having one unfiltered subcube cached rather than multiple filtered subcubes – It is possible to overfill the cache – the SE will stop looking in the cache after it has searched 1000 subcubes – We want to cache lower rather than higher granularities, since the latter can be aggregated from the former in memory – We need a way of working out which granularities are useful
  • 9. Warming the SE cache • We can warm the SE cache by using either: – WITH CACHE, to warm the cache for a single query – not very useful – The CREATE CACHE command • Remember that building aggregations is often a better alternative to warming the SE cache • But in some cases you can’t build aggregations – for example when there are many-to-many relationships
  • 10. CREATE CACHE • Example CREATE CACHE statement: CREATE CACHE FOR [Adventure Works] AS '({[Measures].[Internet Sales Amount]}, {[Date].[Date].[Date].MEMBERS}, {[Product].[Category].[Category].MEMBERS})'
  • 11. Which subcubes should I cache? • The Query Subcube and Query Subcube Verbose events in Profiler show the subcubes requested from the SE by the FE • This is also the information stored in the SSAS query log, stored in SQL Server • Analyse this data manually and find the most commonly-requested, lower-granularity subcubes • Maybe also query the Query Log, or a Profiler trace saved to SQL Server, to find other subcubes – perhaps for queries that have been run recently
  • 12. Warming the FE cache • First, tune your calculations! Ensure use of bulk mode where possible • The only way to warm the FE cache is to run MDX queries containing calculations • Remember, these queries must not: – Include a WITH clause – Subselects • Also, no point trying to cache calculations whose values cannot be cached • And think about how security can impact cache usage
  • 13. Queries to warm the FE Cache • Again, it is worth manually constructing some MDX queries yourself to warm the FE cache • Also, running regularly-used queries (for example those used in SSRS reports) can be a good idea • Can easily collect the queries your users are running by running a Profiler trace, then saving that trace to SQL Server or a .trc file – The Query Begin and Query End events contain the MDX query – Need to filter out those with a WITH clause etc – Watch out for parameterisation (eg SSRS) – Watch out for use of session sets and calculations (eg Excel 2003) – Watch out for queries that slice by Time, where the actual slicer used may change regularly – Think about the impact of dimension security too
  • 14. Memory considerations • SSAS caching can use a lot of memory! • The cache will keep growing until SSAS thinks it is running out of memory: – When memory usage exceeds the % of available system memory specified in the LowMemoryLimit property, data will be dropped from cache – When it exceeds the % specified in the TotalMemoryLimit property, all data will be dropped from cache – We therefore don’t want to exceed the LowMemoryLimit – We also want to avoid paging – We need to leave space for caching real user queries • The FE flat cache is limited to 10% of the TotalMemoryLimit – If it grows bigger than that, it is completely emptied
  • 15. Automating Cache Warming • We should perform cache-warming after cube processing has taken place • Remember – it may take a long time! It should not overlap/interfere with real users querying • We can automate it a number of different ways: – Running SSRS reports on a data-driven subscription – Using the ascmd.exe utility – Building your own SSIS package – the best solution for overall flexibility. • Either fetch queries from a SQL Server table • Or from a Profiler .trc file using the Konesans Trace File Source component
  • 16. Summary • Clearly a lot of problems to watch out for! • However, some cache-warming (however inefficient) is often better than none at all • A perfectly-tuned cube would have little need for cache-warming, but... – Some performance problems we just don’t know about – Some we may not be able to fix (eg with complex calculations, hardware limitations) – Cache warming is likely to have some positive impact in these cases – maybe lots, maybe not much