Essbase ASO PerformanceEssbase ASO Performance
When NOT to Depend on MDX
Dan PressmannTuple, LLC
Dan Pressman, nTuple, LLC 2
AgendaAgenda
IntroductionObjectivesHow and Why Relying on MDX Can Hurt
PerformanceASO Cubes and how they calculateASO Hierarchies and how they interactASO Aggregations
Real-World ExamplesThe Normal Way and How to “Cheat”
Dan Pressman, nTuple, LLC 3
ObjectivesObjectives
Design Hierarchies to Improve Performance of:YTD, QTD and MTD calculationsAverage Daily Balance calculationsAlternate Hierarchies
Reduce Dependence on Aggregation
Hierarchy Design Greatly Affects Performance
Dan Pressman, nTuple, LLC 4
ASO CubesASO Cubes
How many people have seen an ASO cube?
Are you sure?
Maybe you’ve just worked with them?
An ASO cube you can see and touch …
Dan Pressman, nTuple, LLC 5
A PreA Pre--Computer ASO CubeComputer ASO Cube
Dan Pressman, nTuple, LLC 6
PrePre--Computer FactDataComputer FactData
Dan Pressman, nTuple, LLC 7
PrePre--Computer FactDataComputer FactData
Coded FactData:• Punched holes represent
MetaData• Notches represent the
absence of MetaData• Holes & Notches for both:
– Level 0 metadata– Upper Level metadata
• FactData Printed on the card body– Manual Calculation
Dan Pressman, nTuple, LLC 8
PrePre--Computer QueryingComputer Querying
Dan Pressman, nTuple, LLC 9
PrePre--Computer QueryingComputer Querying
• Queries performed with knitting needles– aka Sorting Needles– Multiple query passes
through the data were required
Unless you had …
Dan Pressman, nTuple, LLC 10
PrePre--Computer QueryingComputer Querying
The new and improved –
Multi-Processor Model
Dan Pressman, nTuple, LLC 11
ASO ASO MetaDataMetaData CodingCoding
In Essbase, ASO cubes work the same way for stored hierarchies:
– The Holes and Notches are replaced by a bitmap as seen on the statistics page:
Dan Pressman, nTuple, LLC 12
ASO ASO MetaDataMetaData CodingCoding
In Essbase, ASO cubes work the same way for stored hierarchies:– The Holes and Notches are replaced by bitmap– The needles are replaced by a bitmap mask– The mask passes through all of the FactData “cards”– If all of the “cards” are:
• Coded with upper-level members and alternate hierarchies– i.e. Stored Hierarchies
• In the same “card box” (i.e., memory)
Then Queries are fast and simple
Dan Pressman, nTuple, LLC 13
ASO FactData CodingASO FactData Coding
In Essbase, each Level 0 FactData cell:– In Stored Dimensions/Hierarchies:
• Has a bitmap indicating its L0 “identity” (sibling position) in the primary hierarchy
• Has a bitmap indicating its full ancestry in its primary hierarchy
• No additional bitmap is required indicating its L0 “identity” in any alternate hierarchies
• Has a bitmap indicating its full ancestry in any alternate hierarchies
Dan Pressman, nTuple, LLC 14
ASO FactData CodingASO FactData Coding
In Essbase, each Level 0 FactData cell also has:– In Dynamic Dimensions/Hierarchies:
• A bitmap indicating its L0 “identity” amongst any stored (non- share) members
And of course:8 bytes of real, live FactData
Dan Pressman, nTuple, LLC 15
ASO Bitmap CodingASO Bitmap Coding
Paying attention to the metadata bitmap as seen on the Statistics Page is important because:
– The number of metadata bits is rounded up to the nearest 64-bit (8 byte) multiple
– Each 8-byte FactData cell has at least 8 bytes of metadata attached
– When there are hundreds of millions of FactData cells, a few bits here and a few bits there multiply
– Increase in the Input-Level data size increases the size of the “card” box (memory) required
• Remember, ASO queries are fast if all of the “cards” fit in memory
Dan Pressman, nTuple, LLC 16
ASO QueriesASO Queries
Stored Hierarchies: Fast - allow ASO to be ASO – All queries are eventually resolved to be a
combination of queries against the stored dimensions• Each stored query is a bitmap-mask pass through the
database • Performance is therefore based on the Input-Level Data Size• All stored dimension queries against the same Aggregation
level should be equal• Note: possible exception across multiple members of the
compression dimension
– Calculation order for dynamic dimensions is critical – keep them high up
Dan Pressman, nTuple, LLC 17
ASO QueriesASO Queries
– It can be worth paying the “cost” of increasing the bitmap and the Input-Level data size to increase performance without Aggregation
– There are also ways to design the hierarchy to minimize the size
– Dynamic queries can be used as “dimension translators” to redirect to a stored compound hierarchy hidden in another dimension
Dan Pressman, nTuple, LLC 18
ASO Bitmap Size CalculationASO Bitmap Size Calculation
The bitmap is sized as follows for each dimension:– For Stored Hierarchies:
• The sum for each level of the hierarchy of…– The number of bits required to represent the number of non-
shared siblings of the widest family of siblings for that level
– For Dynamic Hierarchies:• The number of bits required to represent the count of all
stored, non-shared members of the hierarchy
Note: Dimensions with only one stored member do not require any bits in the bitmap
Dan Pressman, nTuple, LLC 19
ASO Bitmap Size CalculationASO Bitmap Size Calculation
Bitmap Size, continued:– For Dimensions with Multiple Hierarchies enabled:
• The number of bits required to represent the number of non- shared siblings of the widest family of siblings for that level across all hierarchies for that dimension
– The number of stored, non-shared members for dynamic hierarchies are considered to be at level 0
• Plus the number of bits required to represent the number hierarchies in the dimension
– If there is only one hierarchy for the dimension, the number of bits required is zero, even if Multiple Hierarchies are enabled
The sum of the bits across all dimensions is then rounded up to the nearest multiple of 64
Dan Pressman, nTuple, LLC 20
ASO Bitmap Coding ExampleASO Bitmap Coding Example
Dan Pressman, nTuple, LLC 21
ASO Bitmap Coding ExampleASO Bitmap Coding Example
Dan Pressman, nTuple, LLC 22
ASO Bitmap Coding SummaryASO Bitmap Coding Summary
• Similar-sized families reduce cost• Ragged hierarchies impose little penalty
– The widest levels are usually at the bottom and are compared with other bottom levels no matter how many generations down
• Alternate hierarchies are not expensive– Only the upper-level members are stored
• Analysis dimensions (TimeSpan, Variance) with only one stored member impose no size cost
Dan Pressman, nTuple, LLC 23
ASO Bitmap Coding OtherASO Bitmap Coding Other
• Label-Only Members impose no size cost– They can be used freely, particularly in Dynamic
Hierarchies to improve readability• Implicit Sharing is still around
– Even with “Never Share” enabled, the only child exists only in the outline and is not represented explicitly in the bitmap
– “Never Share” appears only to have bearing in the cell count calculation for partitions
Dan Pressman, nTuple, LLC 24
ASO AggregationsASO Aggregations
• Are like a DB copy with a different (shortened) bitmap
• Remember, stored alternate hierarchies cannot use upper-level members from the primary hierarchy
• Consider loading aggregate levels of data to enhance performance – Data loads are fast – Data either can be loaded twice or aggregated at the
source for the upper-level load
Dan Pressman, nTuple, LLC 25
ExamplesExamples
• These examples demonstrate different ways of calculating YTD Results based on different cube styles:– Style A
• Year Dimension• Month Dimension• Day Dimension
– Style B• Year Dimension• Combined Month/Day Dimension
– Style C• Combined Year/Month/Day Dimension
• Each Style has a timespan dimension as well as four other dimensions
Dan Pressman, nTuple, LLC 26
Example Example –– Style A2Style A2
Dan Pressman, nTuple, LLC 27
Example Example –– Style A2Style A2
Using MDX to sum 17 days and sum 6 months
• July 17th YTD MDX:SUM(PeriodsToDate([Day].Levels (0) , [Day].CurrentMember
), [TimeSpan].[Per])+ SUM(PeriodsToDate([Month].Levels (0), PrevMember (
[Month].CurrentMember, Level ) ), ( [TimeSpan].[Per], [FullMonth]))
• Requires 23 bitmap passes through the data:
Dan Pressman, nTuple, LLC 28
Example Example –– Style B1Style B1
Dan Pressman, nTuple, LLC 29
Example Example –– Style B1Style B1
Using MDX to sum 197 days
• July 17th YTD MDX:SUM(PeriodsToDate([Period].CurrentMember.Level,
[Period].CurrentMember ), [TimeSpan].[Per])
• Requires 197 bitmap passes through the data
Dan Pressman, nTuple, LLC 30
Example Example –– Style C1Style C1
Dan Pressman, nTuple, LLC 31
Example Example –– Style C1Style C1
Using MDX to sum 197 days
• July 17th YTD MDX:SUM(PeriodsToDate([Date].Levels (0) ,
[Date].CurrentMember ), [TimeSpan].[Per])
• Requires 197 bitmap passes through the data
Dan Pressman, nTuple, LLC 32
Example Example –– Bitmap SizesBitmap Sizes
Dan Pressman, nTuple, LLC 33
Example Example –– Style B2Style B2
Using Improved MDX to sum 17 days and sum 6 months
• July 17th YTD MDX:SUM(tuplerange( ( [Period].CurrentMember.FirstSibling
, [TimeSpan].[Per]) , ( [Period].CurrentMember, [TimeSpan].[Per])))
+ SUM(PeriodsToDate([Period].CurrentMember.Parent.Level, [Period].CurrentMember.Parent ), [TimeSpan].[Per])
• Requires 23 bitmap passes through the data:
Dan Pressman, nTuple, LLC 34
Example Example –– Style C2Style C2
• Using Improved MDX to sum 17 days and sum 6 months
• July 17th YTD MDX:SUM(tuplerange( ( [Date].CurrentMember.FirstSibling
, [TimeSpan].[Per]) , ( [Date].CurrentMember, [TimeSpan].[Per])))
+ SUM(PeriodsToDate([Date].CurrentMember.Parent.Level, [Date].CurrentMember.Parent ), [TimeSpan].[Per])
• Requires 23 bitmap passes through the data:
Dan Pressman, nTuple, LLC 35
Example Example –– Style A3Style A3
Using ASO to roll up the 17 days
MDX to sum the 6 months
Dan Pressman, nTuple, LLC 36
Example Example –– Style A3Style A3
Using ASO to roll up the 17 daysMDX to sum up the 6 months
• July 17th YTD MDX:– INSERT HERE ******
• Requires 7 bitmap passes through the data• Bitmap for the time dimensions increase from 11 to 39 bits
Dan Pressman, nTuple, LLC 37
Example Example –– Style A4Style A4
Using ASO to roll up the 17 days
A separate load of full- month totals
Then use ASO to roll up the full-month totals
Dan Pressman, nTuple, LLC 38
Example Example –– Style A4Style A4
Using ASO to roll up the 17 daysA separate load of full-month totalsThen use ASO to roll up the full-month totals
• July 17th YTD MDX:– INSERT HERE ******
• Requires 2 bitmap passes through the data• Bitmap for the time dimensions increase from 11 to 45 bits
Dan Pressman, nTuple, LLC 39
Example Example –– Style B4Style B4
Using ASO to roll up the 17 days
Using ASO to Roll up the 6 full-months (no separate load required)
Dan Pressman, nTuple, LLC 40
Example Example –– Style B4Style B4
Using ASO to roll up the 17 days Using ASO to Roll up the 6 full-months (no separate
load required)
• July 17th YTD MDX:– INSERT HERE ******
• Requires 2 bitmap passes through the data• Bitmap for the time dimensions increase from 12 to 38 bits
Dan Pressman, nTuple, LLC 41
Example Example –– Style B5Style B5
Using a separate load of monthly YTD totals
Then use ASO to roll up the 17 days and the prior month YTD
Dan Pressman, nTuple, LLC 42
Example Example –– Style B5Style B5
Using a separate load of monthly YTD totalsThen use ASO to roll up the 17 days and the prior
month YTD
• July 17th YTD Simple MDX:– INSERT HERE ******
• Requires 1 bitmap passes through the data• Bitmap for the time dimensions increase from 12 to 39 bits
Dan Pressman, nTuple, LLC 43
Example Example –– Style C3Style C3
Using ASO to roll up the 17 days
MDX to sum up the 6 months
Dan Pressman, nTuple, LLC 44
Example Example –– Style C3Style C3
Using ASO to roll up the 17 daysMDX to sum up the 6 months
• July 17th YTD MDX:– INSERT HERE ******
• Requires 7 bitmap passes through the data• Bitmap for the time dimensions increase from 12 to 38 bits
Dan Pressman, nTuple, LLC 45
Example Example –– Style C5Style C5
Using a separate load of monthly YTD totals
Then use ASO to roll up the 17 days and the prior month YTD
Dan Pressman, nTuple, LLC 46
Example Example –– Style C5Style C5
Using separate load of monthly YTD totalsThen use ASO to roll up the 17 days and the prior
month YTD
• July 17th YTD Simple MDX:– INSERT HERE ******
• Requires 1 bitmap passes through the data• Bitmap for the time dimensions increase from 12 to 39 bits
Dan Pressman, nTuple, LLC 47
ASO Example ASO Example –– Style B5 & C5Style B5 & C5
• No Aggregation needed on this dimension– Turn it off
• “Squeeze” the YTD’s to get QTDs and HTDs
• Rolling time spans require 1 pass in C5 if within the year and 3 in B5 (if spanning years)
Dan Pressman, nTuple, LLC 48
Example Example –– Style DStyle D
Another example which adds the calculation of Average Daily Balances (ADB). The Monthly YTDs and Monthly YTD-ADBs are loaded.
Instead of using MDX to redirect the YTD timespans, a Transparent partion was used from a BSO cube. This way all of the extra roll ups were hidden from the user.
Dan Pressman, nTuple, LLC 49
ASO Example ASO Example –– Style DStyle D
• No Aggregation needed on this dimension– Turn it off
• “Squeeze” the YTD’s to get QTDs and HTDs
• Rolling time spans require 1 pass
Dan Pressman, nTuple, LLC 50
SummarySummary
• Let ASO be ASO• Use “hidden” compound dimensions
– Let ASO roll them up– Redirect/translate with MDX to maximize the use of
“hidden” dimensions
Dan Pressman, nTuple, LLC 51
Q & AQ & A
Questions, Answers and Discussion
Presenter: Dan PressmannTuple, LLC