Upload
itay-braun
View
2.397
Download
3
Embed Size (px)
DESCRIPTION
Part two out of three
Citation preview
Extreme SSAS – Part IIItay Braun | CTO | Twingo
• Methodology• Monitoring• Enhancing Queries Performance• Enhancing Processing
Performance
Take Aways
• There are many white papers about the subject, tools and reports.
• 20-80 law. In this session I’ll focus on the easy-to-implement solutions. Solving 80% of your problems in 20% of the time.
• In my blog you can find links to all the relevant info.
Performance Enhancement - Methodology
• Monitor the server– Performance Counters– Dynamic Management Views– Profiler Trace Files– Execution Log
• Analyze Bottlenecks– Formula Engine vs. Storage Engine– CPU– IO– Memory
• Improve Queries Response Time• Minimize Processing Time Frame
• Methodology• Monitoring• Enhancing Queries Performance• Enhancing Processing
Performance
Formula Engine vs. Storage Engine
• Storage Engine• Formula Engine• Do I need more memory, better storage or
more CPU?
Performance Counters
• Quick Performance Overview• Use SCOM, SQL Server Data Collectors,
free built in PerfMon or 3rd party tools• Full list of recommended counters can be
found in my blog
Dynamic Management Views
• More detailed analysis• Schema related views and current status
related views• Use SSIS package to save DMV results to
tables for further analysis
Demo
Demo - DMV
• Using Dynamic Management Views
Execution Log
• Built-in table used for– General Statistics– Usage Based Aggregation Design
• Sample reports can be found in my blog
Demo
Demo – OLAPQueryLog
• Configuring OlapQueryLog• Analyze the data in the table using reports
Profiler
• Used for deep and thorough performance analysis
• Use carefully, the trace might affect performance
• More information at the White Paper: Analyzing MDX Performance Bottlenecks
Demo
Demo - Profiler
• Monitoring Queries on cold vs. warm cache.
MDX Studio
• Used to deeply analyze MDX Queries.• Compares behavior on cold vs. warm
cache.• Shows used partitions
• Methodology• Monitoring• Enhancing Queries Performance• Enhancing Processing
Performance
Cache Warmer
• Another simple no-brainer solution• Monitor the top queries using Profiler• Run the top queries using SSIS• Or, use CREATE CACHE command
How Analysis Services answers queries
Formula Engine works out what data isneeded for each query,and requests it from theStorage Engine
Storage Enginehandles retrieval of raw data from disk, and any aggregation required
MDX Query In Cellset Out
Query Subcube Requests
Cache
Cache
Disk
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
Warming the FE cache
• First, tune your calculations! • 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
Demo
Demo - Cache Warmer
• Using Create Cache Command
Common Cube Design Mistakes
• The number of cubes and dimensions– Dimensions with few attributes and no
hierarchies– Wide cubes (“gray” Dimension Usage)
• Attribute Relationships– Should be aligned with the hierarchies
Common Cube Design Mistakes
• Poor aggregation design – Aggregation Usage Wizard
• Bad partition design – White paper: Distinct Count Optimization– Partition size between 2M and 20M records
Demo
Demo – Cube Design
• AMO Warnings• Attribute Relationships• About Aggregations• Usage Based Wizard
Common Cube Design Mistakes
• Poor aggregation design – Aggregation Usage Wizard
• Sub optimal MDX • Bad partition design – White paper: Distinct Count Optimization– Partition size between 2M and 20M records
• Methodology• Monitoring• Enhancing Queries Performance• Enhancing Processing
Performance
Enhancing Source Query
• Analyze the time needed to bring the data vs. building the partitions and aggregations
• Analyze the Execution Plan
PROCESSING METHODS
Processing Methods
• Analysis Services Processing Best Practices
• Measures Groups and Partitions vs. Dimensions
• Large dimensions can not be partitioned• Dimension: – Full – Process Update– Process Add– Flexible vs. Rigid Aggs.
Processing Methods
• Cube Processing: Full vs. Data + Index
Processing Log Analysis
• How much time does it take to:– Process each dimension– Process each partition– Process the aggregation of each partition
• Use SSIS to process the cube. Use SQL Log provider to save the Process Log.
• Sample Reports in my blog
Demo
Demo – Processing Log
• Processing Log Analysis
• Monitor the SSAS Server to identify performance Bottlenecks
• Partitioning is the key to fast processing• Improving the queries is more complicated.