Presentation is loading. Please wait.

Presentation is loading. Please wait.

Adam Jorgensen Pragmatic Works Performance Optimization in SQL Server Analysis Services 2008.

Similar presentations


Presentation on theme: "Adam Jorgensen Pragmatic Works Performance Optimization in SQL Server Analysis Services 2008."— Presentation transcript:

1 Adam Jorgensen Pragmatic Works Performance Optimization in SQL Server Analysis Services 2008

2 Agenda SSAS Query Processing Architecture Enhancing Query Performance Improving Processing Performance Tuning Server Resources

3 Query Processing Architecture Session Management Query Processing Data Retrieval Session Management XML/A Listener Session ManagerSecurity Manager Query Processing Query Processor Query Processor Cache Data Retrieval Storage Engine Storage Engine Cache Dimension Data Attribute Store Hierarchy Store Measure Group Data Fact Data Aggregations Client Application MDX Query

4 Job Architecture Coordinator Job Job 1 Thread Request Job 2 Thread Job N Thread … CoordinatorExecutionMode Negative means max number of jobs per core Zero means no limit Positive means number of jobs per server Default is -4 Works in tandem with MAXTHREADS and MAXPARALLEL

5 Query Processor Executes MDX Queries and returns cell and row sets. Builds an execution Plan to translate request into one or more SubCube requests. Uses the Query Processor Cache to store the results for reusability

6 Query Processor Cache 3 Contexts Cache Rules – Calculations created at query time – Context is chose by scope – Try for maximum re-use in the Global Cache Partial Expressions are not Cached Global Context Session Context Query Context

7 Data Retrieval Coordinator Job First Segment Job Thread Second Segment Job Thread Last Segment Job Thread … Creates Sub- Cube Request Storage Engine Cache (Y/N) Aggregation (Y/N) Fact Table/Partition

8 Agenda SSAS Query Processing Architecture Enhancing Query Performance Improving Processing Performance Tuning Server Resources

9 Enhancing Query Performance Base lining Query Speed Diagnosing The Problem Optimizing Dimensions Maximizing Aggregations Usage Based Optimization Using Partitions Optimizing MDX Cache Warming

10 Base Lining Query Speed Trace Info – 0 – attribute is not included in query – * - ever member was requested – + - two or more members were requested – - a single member of the attribute was hit Clear Cache Trace Query Warm Cache Trace Again Compare

11 Diagnosing the Problem Storage Engine – Long running sub-cube events Optimize dimension design Design aggregations Use partitions Query Processor See delay in other steps (query processing) Optimize MDX Look for redundant queries

12 Demo Using SSAS and Profiler Get the query Excel is running

13 Identify Attribute Relationships Default relations to Key Base for Indexes Cross products dont need to go through key Aggregations built on attributes can be used for related attributes Flexible vs. Rigid

14 Implementing Effective User Hierarchies Attribute vs. User Hierarchies – Aggregation Usage Property Natural vs. Unnatural Hierarchies

15 Demo Attribute Relationships and Hierachies

16 Using Partitions Advantages – Partition Slicing – Aggregation Design Tips for Using Partitions – Slide Aggregations along partition hierarchy i.e. – Last 7 days, Last 30 Days, 90, 6 months, etc.. – Indexes or slices will not be defines for partitions with fewer rows (4096 default) Sizing Increasing processing speed and flexibility Increase manageability of bringing in new data Support multiple aggregation designs

17 Demo Implementing Partitions

18 Maximizing Aggregation Value Detecting Aggregation Hits Interpreting Aggregations Building, Suggesting, Influencing Aggregations

19 Demo Aggregations and Usage Based Optimization

20 Agenda SSAS Query Processing Architecture Enhancing Query Performance Improving Processing Performance Tuning Server Resources

21 Processing Job Overview Parent – Child Jobs Best Opportunity to Increase Performance and Scale Fact Table & Aggregations Partition Measure Group Parent Processing Job Parent Partition/ Child Processing Child Fact Data Child Aggregation Parent Partition/ Child Processing Child Fact Data

22 Where Are You Spending Your Time? Partition or Dimension Processing ? ProcessFull vs. ProcessData and ProcessIndex During ProcessData – MSOLAP:Processing – Rows read/Sec >0 During ProcessIndex – MSOLAP:Proc Aggregations – Row created/Sec > 0

23 Dimension Processing Best Practices Use SQL Views to Implement Query Binding Optimize Attribute Processing Across Multiple Sources Reduce Unnecessary Attributes Adjust/Remove Bitmap Indexes Tune Relational Processing Query

24 Partition Processing Architecture Processes Using Jobs Three Concurrent Threads – Send SQL to extract source data – LookUp Dimension Keys and populate processing buffer – Write Buffer to disk when it fills Aggregations and Bitmap Indexes – May also overflow to disk – created in memory during processing Process Fact Data Build Aggregations Build Bitmap Indexes

25 Partition Processing Best Practices Inserts – ProcessFull vs. ProcessAdd – Rotating Partitions Updates – ProcessFull – Journaling to only implement Inserts (See Insert Techniques) Deletes – Partitioning – ProcessUpdate – Remove Data From Table and ProcessFull (longer) Pick Efficient Data Types

26 Tuning the Relational Query Minimal Joins in Source Queries Partitioning Alignment – Each SSAS partition should only hit 1 Relational Partition – More than 1 cube partition can hit 1 relational partition Clustered Indexes – Especially without 1:1 partition relationship Keep FillFactor VERY high Data Compression – Reduce IO Reduce Locking when possible

27 Tuning ProcessIndex Phase Avoid Spilling Data to Disk – MSOLAP:Proc Aggregations\Temp file bytes written/sec MSOLAP:Proc Aggregations – Row created/sec – Increase means faster aggregation processing Eliminate IO bottleneck Increase Partitions for Parallelism

28 Agenda SSAS Query Processing Architecture Enhancing Query Performance Improving Processing Performance Tuning Server Resources

29 PreAllocate Physical Ram for SSAS – Hard reservation – otherwise memory will be released when not under load Using Large Pages – Lock Pages in Memory – Cannot be swapped to page file Need to watch Carefully Leave 20% for the OS Disable Flight Recorder

30 Questions and Where to Find Adam


Download ppt "Adam Jorgensen Pragmatic Works Performance Optimization in SQL Server Analysis Services 2008."

Similar presentations


Ads by Google