42
Extreme SSAS – Part II Itay Braun | CTO | Twingo

Extreme SSAS - Part II

Embed Size (px)

DESCRIPTION

Part two out of three

Citation preview

Page 1: Extreme SSAS - Part II

Extreme SSAS – Part IIItay Braun | CTO | Twingo

Page 2: Extreme SSAS - Part II

• Methodology• Monitoring• Enhancing Queries Performance• Enhancing Processing

Performance

Page 3: Extreme SSAS - Part II

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.

Page 4: Extreme SSAS - Part II

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

Page 5: Extreme SSAS - Part II

• Methodology• Monitoring• Enhancing Queries Performance• Enhancing Processing

Performance

Page 6: Extreme SSAS - Part II

Formula Engine vs. Storage Engine

• Storage Engine• Formula Engine• Do I need more memory, better storage or

more CPU?

Page 7: Extreme SSAS - Part II

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

Page 8: Extreme SSAS - Part II

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

Page 9: Extreme SSAS - Part II

Demo

Page 10: Extreme SSAS - Part II

Demo - DMV

• Using Dynamic Management Views

Page 11: Extreme SSAS - Part II

Execution Log

• Built-in table used for– General Statistics– Usage Based Aggregation Design

• Sample reports can be found in my blog

Page 12: Extreme SSAS - Part II

Demo

Page 13: Extreme SSAS - Part II

Demo – OLAPQueryLog

• Configuring OlapQueryLog• Analyze the data in the table using reports

Page 14: Extreme SSAS - Part II

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

Page 15: Extreme SSAS - Part II

Demo

Page 16: Extreme SSAS - Part II

Demo - Profiler

• Monitoring Queries on cold vs. warm cache.

Page 17: Extreme SSAS - Part II

MDX Studio

• Used to deeply analyze MDX Queries.• Compares behavior on cold vs. warm

cache.• Shows used partitions

Page 18: Extreme SSAS - Part II

• Methodology• Monitoring• Enhancing Queries Performance• Enhancing Processing

Performance

Page 19: Extreme SSAS - Part II

Cache Warmer

• Another simple no-brainer solution• Monitor the top queries using Profiler• Run the top queries using SSIS• Or, use CREATE CACHE command

Page 20: Extreme SSAS - Part II

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

Page 21: Extreme SSAS - Part II

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

Page 22: Extreme SSAS - Part II

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

Page 23: Extreme SSAS - Part II

CREATE CACHE

• Example CREATE CACHE statement:

CREATE CACHE FOR [Adventure Works] AS'({[Measures].[Internet Sales Amount]},{[Date].[Date].[Date].MEMBERS},{[Product].[Category].[Category].MEMBERS})'

Page 24: Extreme SSAS - Part II

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

Page 25: Extreme SSAS - Part II

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

Page 26: Extreme SSAS - Part II

Demo

Page 27: Extreme SSAS - Part II

Demo - Cache Warmer

• Using Create Cache Command

Page 28: Extreme SSAS - Part II

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

Page 29: Extreme SSAS - Part II

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

Page 30: Extreme SSAS - Part II

Demo

Page 31: Extreme SSAS - Part II

Demo – Cube Design

• AMO Warnings• Attribute Relationships• About Aggregations• Usage Based Wizard

Page 32: Extreme SSAS - Part II

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

Page 33: Extreme SSAS - Part II

• Methodology• Monitoring• Enhancing Queries Performance• Enhancing Processing

Performance

Page 34: Extreme SSAS - Part II

Enhancing Source Query

• Analyze the time needed to bring the data vs. building the partitions and aggregations

• Analyze the Execution Plan

Page 35: Extreme SSAS - Part II

PROCESSING METHODS

Page 36: Extreme SSAS - Part II

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.

Page 37: Extreme SSAS - Part II

Processing Methods

• Cube Processing: Full vs. Data + Index

Page 38: Extreme SSAS - Part II

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

Page 39: Extreme SSAS - Part II

Demo

Page 40: Extreme SSAS - Part II

Demo – Processing Log

• Processing Log Analysis

Page 41: Extreme SSAS - Part II

• Monitor the SSAS Server to identify performance Bottlenecks

• Partitioning is the key to fast processing• Improving the queries is more complicated.

Page 42: Extreme SSAS - Part II