SlideShare une entreprise Scribd logo
1  sur  31
Télécharger pour lire hors ligne
NASI SPONSORZY I PARTNERZY
(More) Common Analysis Services
Multidimensional Design Mistakes and How to
Avoid Them

Chris Webb
Who Am I?
•

Chris Webb
• Email: chris@crossjoin.co.uk
• Twitter @Technitrain

•
•

Analysis Services consultant and trainer:
www.crossjoin.co.uk & www.technitrain.com
Co-author:
• MDX Solutions
• Expert Cube Development with SSAS 2008
• Analysis Services 2012: The BISM Tabular Model

•
•

SQL Server MVP
Blogger: http://cwebbbi.wordpress.com
Agenda
•
•
•
•
•
•
•
•
•

Why good cube design is a Good Thing
Using built-in best practices in BIDS
Precon recap
Parent/child pain
MDX vs modelling
Partition elimination
Unused and/or unprocessed aggregations
NON_EMPTY_BEHAVIOR
Cell Security
Why Good Design is Important!
• As if you needed reasons…?
• Good design
=
good performance
=
faster initial development
=
easy further development
=
simple maintenance
• This is not an exhaustive list, but a selection of design
problems and mistakes I’ve seen on consultancy
engagements
Best Practices in BIDS
• Don’t ignore the blue squiggly lines in BIDS!
– They sometimes make useful recommendations about
what you’re doing

• Actively dismissing them, with comments, is a useful
addition to documentation
• As always, official ‘best practices’ aren’t always best
practices in all situations
Common Design Mistakes
• Three questions need to be asked:
– What’s the problem?
– What bad things will happen as a result?
– What can I do to fix it (especially after I’ve gone into
production)?

• This is not a name-and-shame session!
Stuff From My Precon
•
•
•
•

Don’t use unfriendly names
Don’t create unnecessary attributes
Don’t do ETL in your DSV
Don’t create many small cubes instead of one big
one
• Don’t create one big cube instead of many smaller
ones

SQLDay 2013
Problem: Parent Child Hierarchies
• Parent Child hierarchies are the only way to model
hierarchies where you don’t know the number of
levels in advance
• They are also very flexible, leading some people to
use them more often than they should
Consequences: Parent Child
• Parent Child hierarchies can lead to slow query
performance
– No aggregations can be built at levels inside the
hierarchy
– Slow anyway

• They can also be a nightmare for
– Scoping advanced MDX calculations
– Dimension security
Fix: Parent Child
• If you know, or can assume, the maximum depth of your
hierarchy, there’s an alternative
• Normal user hierarchies can be made ‘Ragged’ with the
HideMemberIf property
– Hides members if their parent has no name, or the same
name as them

• Still has performance issues, but less than parent/child
• You can use the BIDS Helper “parent/child naturaliser” to
convert the underlying relational table to a level-based
structure
Problem: Over-reliance on MDX
• As with the DSV, it can be tempting to use MDX
calculations instead of making structural changes to
cubes and dimensions
• A simple example is to create a ‘grouping’ calculated
member instead of creating a new attribute
• Other examples include pivoting measures into a
dimension, or doing m2m in MDX
Consequences: Over-reliance on MDX
• MDX should always be your last resort:
• Pure MDX calculations are always going to be the
slowest option for query performance
• They are also the least-easily maintainable part of a
cube
• The more complex calculations you have, the more
difficult it is to make other calculations work
Fix: Over-reliance on MDX
• Redesigning your cube is a radical option but can pay
big dividends in terms of performance
• Risks breaking existing reports and queries but your
users may be ok with this to get more speed
Problem: Partition Elimination
• SSAS will usually only query the partitions that
contain the data it needs
• This depends on the way it stores the minimum and
maximum values of DataIDs (internal keys) in each
partition

SQLDay 2013
Consequences: Partition Elimination
• Slow performance – if SSAS queries too many
partitions for a single query
• Although the extra cache might make future queries
faster…

SQLDay 2013
Fix: Partition Elimination
•
•
•
•

Rewrite your MDX
Set the slice property
Order your members by DataID if possible
Use the connection string properties
Disable Prefetch Cache=True; Cache Ratio=1

SQLDay 2013
Problem: Unused Aggregations
• Aggregations are the most important SSAS feature
for performance
• Most people know they need to build some and run
the Aggregation Design Wizard…
• …but don’t know whether they’re being used or not
Consequences: Unused Aggregations
• Slow queries!
• If you haven’t built the right aggregations, then your
queries won’t get any performance benefit
• You’ll waste time processing these aggregations, and
waste disk space storing them
Fix: Unused Aggregations
• Design some aggregations!
• Rerun the Aggregation Design Wizard and set the
Aggregation Usage property appropriately
• Perform Usage-Based Optimisation
• Design aggregations manually for queries that are
still slow and could benefit from aggregations
Problem: Unprocessed Aggregations
• Even if you’ve designed aggregations that are useful
for your queries, you need to ensure they’re
processed
• Running a Process Update on a dimension will drop
some or all Flexible aggregations (depends on which
version of SSAS)
Consequences: Unprocessed
Aggregations
• Slow queries! (Again)
Fix: Unprocessed Aggregations
• Run a Process Default or a Process Index on your
cube after you have run a Process Update on any
dimensions
• Note that this will result in:
– Longer processing times overall
– More disk space used

• But it will at least mean that your queries run faster
Problem: Non_Empty_Behavior
• The Non_Empty_Behavior property was introduced
in SSAS 2000 as a performance hint
• It was very important in SSAS 2000/2005
• It says:
If Regular Measure A is Null
Then Calculated Measure B will be Null
• But it is usually set incorrectly
• And from SSAS 2008 on it is mostly unnecessary

SQLDay 2013
Consequences: Non_Empty_Behavior
• Setting Non_Empty_Behavior incorrectly can
– At best, make no difference to your performance
– At worst, result in incorrect query results

SQLDay 2013
Fix: Non_Empty_Behavior
• Don’t set it!
• Rewrite your calculations to check for null values:
IIF(
ISEMPTY(MEASURES.A),
NULL,
<CALCULATION>
)

SQLDay 2013
Problem: Cell Security
• Cell security allows you to secure individual cells in a
cube
• At first sight, it is the only option: it does things
dimension security cannot do…

SQLDay 2013
Consequences: Cell Security
• Setting cell security correctly can be very difficult
• Read and read contingent cell security can be even
more confusing
• Performance is often very bad with cell security:
– Forces cell-by-cell mode
– Forces Formula Engine caching to query scope

SQLDay 2013
Fix: Cell Security
• The answer is to use Dimension Security instead
• But how…?
• Create a new dimension that contains the
combinations of members that you want to secure
• Then use Dimension Security on it
• Doesn’t work if you need to secure measures 

SQLDay 2013
Thanks!
NASI SPONSORZY I PARTNERZY

Organizacja: Polskie Stowarzyszenie Użytkowników SQL Server - PLSSUG
Produkcja: DATA MASTER Maciej Pilecki

Contenu connexe

En vedette

SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&RunningSQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&RunningPolish SQL Server User Group
 
SQL DAY 2012 | DEV Track | Session 9 - Data Mining Analiza Przepływowa by M.S...
SQL DAY 2012 | DEV Track | Session 9 - Data Mining Analiza Przepływowa by M.S...SQL DAY 2012 | DEV Track | Session 9 - Data Mining Analiza Przepływowa by M.S...
SQL DAY 2012 | DEV Track | Session 9 - Data Mining Analiza Przepływowa by M.S...Polish SQL Server User Group
 
SQL DAY 2012 | DEV Track | Session 6 - Master Data Management by W.Bielski 6 ...
SQL DAY 2012 | DEV Track | Session 6 - Master Data Management by W.Bielski 6 ...SQL DAY 2012 | DEV Track | Session 6 - Master Data Management by W.Bielski 6 ...
SQL DAY 2012 | DEV Track | Session 6 - Master Data Management by W.Bielski 6 ...Polish SQL Server User Group
 
26th_Meetup_of_PLSSUG_WROCLAW-ColumnStore_Indexes_byBeataZalewa_scripts
26th_Meetup_of_PLSSUG_WROCLAW-ColumnStore_Indexes_byBeataZalewa_scripts26th_Meetup_of_PLSSUG_WROCLAW-ColumnStore_Indexes_byBeataZalewa_scripts
26th_Meetup_of_PLSSUG_WROCLAW-ColumnStore_Indexes_byBeataZalewa_scriptsPolish SQL Server User Group
 
SQLDay2013_PawełPotasiński_GeografiaSQLServer2012
SQLDay2013_PawełPotasiński_GeografiaSQLServer2012SQLDay2013_PawełPotasiński_GeografiaSQLServer2012
SQLDay2013_PawełPotasiński_GeografiaSQLServer2012Polish SQL Server User Group
 
38Spotkanie_PLSSUGweWroclawiu_Keynote
38Spotkanie_PLSSUGweWroclawiu_Keynote38Spotkanie_PLSSUGweWroclawiu_Keynote
38Spotkanie_PLSSUGweWroclawiu_KeynoteTobias Koprowski
 
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET DeveloperSQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET DeveloperPolish SQL Server User Group
 
SQL DAY 2012 | DEV Track | Session 8 - Getting Dimension with Data by C.Tecta...
SQL DAY 2012 | DEV Track | Session 8 - Getting Dimension with Data by C.Tecta...SQL DAY 2012 | DEV Track | Session 8 - Getting Dimension with Data by C.Tecta...
SQL DAY 2012 | DEV Track | Session 8 - Getting Dimension with Data by C.Tecta...Polish SQL Server User Group
 
GoldenLine.pl - Od Startupu do... Startupu :-)
GoldenLine.pl - Od Startupu do... Startupu :-)GoldenLine.pl - Od Startupu do... Startupu :-)
GoldenLine.pl - Od Startupu do... Startupu :-)Karol Traczykowski
 
Maintenance_Plans_Zupełnie_Znienacka
Maintenance_Plans_Zupełnie_ZnienackaMaintenance_Plans_Zupełnie_Znienacka
Maintenance_Plans_Zupełnie_ZnienackaTobias Koprowski
 
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)Krzysztof Kotowicz
 

En vedette (19)

SQLDay2013_ChrisWebb_DAXMD
SQLDay2013_ChrisWebb_DAXMDSQLDay2013_ChrisWebb_DAXMD
SQLDay2013_ChrisWebb_DAXMD
 
SQLDay2013_GrzegorzStolecki_RealTimeOLAP
SQLDay2013_GrzegorzStolecki_RealTimeOLAPSQLDay2013_GrzegorzStolecki_RealTimeOLAP
SQLDay2013_GrzegorzStolecki_RealTimeOLAP
 
SQLDay2013_GrzegorzStolecki_KonsolidacjaBI
SQLDay2013_GrzegorzStolecki_KonsolidacjaBISQLDay2013_GrzegorzStolecki_KonsolidacjaBI
SQLDay2013_GrzegorzStolecki_KonsolidacjaBI
 
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&RunningSQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
SQLDay2013_DennyCherry_GettingSQLServiceBrokerUp&Running
 
SQLDay2011_Sesja02_Collation_Marek Adamczuk
SQLDay2011_Sesja02_Collation_Marek AdamczukSQLDay2011_Sesja02_Collation_Marek Adamczuk
SQLDay2011_Sesja02_Collation_Marek Adamczuk
 
SQLDay2013_MaciejPilecki_Lock&Latches
SQLDay2013_MaciejPilecki_Lock&LatchesSQLDay2013_MaciejPilecki_Lock&Latches
SQLDay2013_MaciejPilecki_Lock&Latches
 
SQL DAY 2012 | DEV Track | Session 9 - Data Mining Analiza Przepływowa by M.S...
SQL DAY 2012 | DEV Track | Session 9 - Data Mining Analiza Przepływowa by M.S...SQL DAY 2012 | DEV Track | Session 9 - Data Mining Analiza Przepływowa by M.S...
SQL DAY 2012 | DEV Track | Session 9 - Data Mining Analiza Przepływowa by M.S...
 
SQL DAY 2012 | DEV Track | Session 6 - Master Data Management by W.Bielski 6 ...
SQL DAY 2012 | DEV Track | Session 6 - Master Data Management by W.Bielski 6 ...SQL DAY 2012 | DEV Track | Session 6 - Master Data Management by W.Bielski 6 ...
SQL DAY 2012 | DEV Track | Session 6 - Master Data Management by W.Bielski 6 ...
 
26th_Meetup_of_PLSSUG_WROCLAW-ColumnStore_Indexes_byBeataZalewa_scripts
26th_Meetup_of_PLSSUG_WROCLAW-ColumnStore_Indexes_byBeataZalewa_scripts26th_Meetup_of_PLSSUG_WROCLAW-ColumnStore_Indexes_byBeataZalewa_scripts
26th_Meetup_of_PLSSUG_WROCLAW-ColumnStore_Indexes_byBeataZalewa_scripts
 
SQLDay2013_PawełPotasiński_GeografiaSQLServer2012
SQLDay2013_PawełPotasiński_GeografiaSQLServer2012SQLDay2013_PawełPotasiński_GeografiaSQLServer2012
SQLDay2013_PawełPotasiński_GeografiaSQLServer2012
 
38Spotkanie_PLSSUGweWroclawiu_Keynote
38Spotkanie_PLSSUGweWroclawiu_Keynote38Spotkanie_PLSSUGweWroclawiu_Keynote
38Spotkanie_PLSSUGweWroclawiu_Keynote
 
Sql day2015 fts
Sql day2015 ftsSql day2015 fts
Sql day2015 fts
 
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET DeveloperSQLDay2013_Denny Cherry - Table indexing for the .NET Developer
SQLDay2013_Denny Cherry - Table indexing for the .NET Developer
 
SQLDay2013_ChrisWebb_CubeDesign&PerformanceTuning
SQLDay2013_ChrisWebb_CubeDesign&PerformanceTuningSQLDay2013_ChrisWebb_CubeDesign&PerformanceTuning
SQLDay2013_ChrisWebb_CubeDesign&PerformanceTuning
 
SQL DAY 2012 | DEV Track | Session 8 - Getting Dimension with Data by C.Tecta...
SQL DAY 2012 | DEV Track | Session 8 - Getting Dimension with Data by C.Tecta...SQL DAY 2012 | DEV Track | Session 8 - Getting Dimension with Data by C.Tecta...
SQL DAY 2012 | DEV Track | Session 8 - Getting Dimension with Data by C.Tecta...
 
GoldenLine.pl - Od Startupu do... Startupu :-)
GoldenLine.pl - Od Startupu do... Startupu :-)GoldenLine.pl - Od Startupu do... Startupu :-)
GoldenLine.pl - Od Startupu do... Startupu :-)
 
Maintenance_Plans_Zupełnie_Znienacka
Maintenance_Plans_Zupełnie_ZnienackaMaintenance_Plans_Zupełnie_Znienacka
Maintenance_Plans_Zupełnie_Znienacka
 
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)
Kompletny przewodnik po SQL injection dla developerów PHP (i nie tylko)
 
Śniadanie Daje Moc
Śniadanie Daje MocŚniadanie Daje Moc
Śniadanie Daje Moc
 

Similaire à SQLDay2013_ChrisWebb_SSASDesignMistakes

[db tech showcase Tokyo 2017] C16: Azure SQL Database - Are you ready for the...
[db tech showcase Tokyo 2017] C16: Azure SQL Database - Are you ready for the...[db tech showcase Tokyo 2017] C16: Azure SQL Database - Are you ready for the...
[db tech showcase Tokyo 2017] C16: Azure SQL Database - Are you ready for the...Insight Technology, Inc.
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabasesAdi Challa
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data WarehousingDavide Mauri
 
Schema less table & dynamic schema
Schema less table & dynamic schemaSchema less table & dynamic schema
Schema less table & dynamic schemaDavide Mauri
 
Challenges in Querying a Distributed Relational Database
Challenges in Querying a Distributed Relational DatabaseChallenges in Querying a Distributed Relational Database
Challenges in Querying a Distributed Relational DatabaseScaleBase
 
The Future of Database Development
The Future of Database DevelopmentThe Future of Database Development
The Future of Database DevelopmentSteve Jones
 
The Death of the Star Schema
The Death of the Star SchemaThe Death of the Star Schema
The Death of the Star SchemaDATAVERSITY
 
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site ReviewECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site ReviewKenny Buntinx
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systemselliando dias
 
Database continuous integration, unit test and functional test
Database continuous integration, unit test and functional testDatabase continuous integration, unit test and functional test
Database continuous integration, unit test and functional testHarry Zheng
 
Guided Interaction: Rethinking the Query-Result Paradigm
Guided Interaction: Rethinking the Query-Result ParadigmGuided Interaction: Rethinking the Query-Result Paradigm
Guided Interaction: Rethinking the Query-Result Paradigmarnabdotorg
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL DevelopersIke Ellis
 
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedRoman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedMSDEVMTL
 
Optimizing Browser Rendering
Optimizing Browser RenderingOptimizing Browser Rendering
Optimizing Browser Renderingmichael.labriola
 
Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)Guy Harrison
 
Geek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringGeek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringIDERA Software
 
Data Vault 2.0 Demystified: East Coast Tour
Data Vault 2.0 Demystified: East Coast TourData Vault 2.0 Demystified: East Coast Tour
Data Vault 2.0 Demystified: East Coast TourWhereScape
 
Dynamic sql for efficient searching
Dynamic sql for efficient searchingDynamic sql for efficient searching
Dynamic sql for efficient searchingdamienjoyce
 
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!ScaleBase
 

Similaire à SQLDay2013_ChrisWebb_SSASDesignMistakes (20)

[db tech showcase Tokyo 2017] C16: Azure SQL Database - Are you ready for the...
[db tech showcase Tokyo 2017] C16: Azure SQL Database - Are you ready for the...[db tech showcase Tokyo 2017] C16: Azure SQL Database - Are you ready for the...
[db tech showcase Tokyo 2017] C16: Azure SQL Database - Are you ready for the...
 
NoSQLDatabases
NoSQLDatabasesNoSQLDatabases
NoSQLDatabases
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data Warehousing
 
Schema less table & dynamic schema
Schema less table & dynamic schemaSchema less table & dynamic schema
Schema less table & dynamic schema
 
Challenges in Querying a Distributed Relational Database
Challenges in Querying a Distributed Relational DatabaseChallenges in Querying a Distributed Relational Database
Challenges in Querying a Distributed Relational Database
 
The Future of Database Development
The Future of Database DevelopmentThe Future of Database Development
The Future of Database Development
 
The Death of the Star Schema
The Death of the Star SchemaThe Death of the Star Schema
The Death of the Star Schema
 
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site ReviewECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
ECMDay2015 - Kent Agerlund – Configuration Manager 2012 – A Site Review
 
Storage Systems For Scalable systems
Storage Systems For Scalable systemsStorage Systems For Scalable systems
Storage Systems For Scalable systems
 
Database continuous integration, unit test and functional test
Database continuous integration, unit test and functional testDatabase continuous integration, unit test and functional test
Database continuous integration, unit test and functional test
 
Guided Interaction: Rethinking the Query-Result Paradigm
Guided Interaction: Rethinking the Query-Result ParadigmGuided Interaction: Rethinking the Query-Result Paradigm
Guided Interaction: Rethinking the Query-Result Paradigm
 
11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers11 Goals of High Functioning SQL Developers
11 Goals of High Functioning SQL Developers
 
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedRoman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
 
Optimizing Browser Rendering
Optimizing Browser RenderingOptimizing Browser Rendering
Optimizing Browser Rendering
 
Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)Top 10 tips for Oracle performance (Updated April 2015)
Top 10 tips for Oracle performance (Updated April 2015)
 
Dbms fast track 3/3
Dbms fast track 3/3Dbms fast track 3/3
Dbms fast track 3/3
 
Geek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringGeek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database Mirroring
 
Data Vault 2.0 Demystified: East Coast Tour
Data Vault 2.0 Demystified: East Coast TourData Vault 2.0 Demystified: East Coast Tour
Data Vault 2.0 Demystified: East Coast Tour
 
Dynamic sql for efficient searching
Dynamic sql for efficient searchingDynamic sql for efficient searching
Dynamic sql for efficient searching
 
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
ScaleBase Webinar: Scaling MySQL - Sharding Made Easy!
 

Plus de Polish SQL Server User Group

26th_Meetup_of_PLSSUG-ColumnStore_Indexes_byBeataZalewa_session
26th_Meetup_of_PLSSUG-ColumnStore_Indexes_byBeataZalewa_session26th_Meetup_of_PLSSUG-ColumnStore_Indexes_byBeataZalewa_session
26th_Meetup_of_PLSSUG-ColumnStore_Indexes_byBeataZalewa_sessionPolish SQL Server User Group
 
SQLDay2011_Sesja03_Fakty,MiaryISwiatRealny_GrzegorzStolecki
SQLDay2011_Sesja03_Fakty,MiaryISwiatRealny_GrzegorzStoleckiSQLDay2011_Sesja03_Fakty,MiaryISwiatRealny_GrzegorzStolecki
SQLDay2011_Sesja03_Fakty,MiaryISwiatRealny_GrzegorzStoleckiPolish SQL Server User Group
 
SQLDay2011_Sesja01_ModelowanieIZasilanieWymiarówHurtowniDanych_ŁukaszGrala
SQLDay2011_Sesja01_ModelowanieIZasilanieWymiarówHurtowniDanych_ŁukaszGralaSQLDay2011_Sesja01_ModelowanieIZasilanieWymiarówHurtowniDanych_ŁukaszGrala
SQLDay2011_Sesja01_ModelowanieIZasilanieWymiarówHurtowniDanych_ŁukaszGralaPolish SQL Server User Group
 
SQLDay2011_Sesja05_MicrosoftSQLServerExecutionPlansFromCompilationToCachingTo...
SQLDay2011_Sesja05_MicrosoftSQLServerExecutionPlansFromCompilationToCachingTo...SQLDay2011_Sesja05_MicrosoftSQLServerExecutionPlansFromCompilationToCachingTo...
SQLDay2011_Sesja05_MicrosoftSQLServerExecutionPlansFromCompilationToCachingTo...Polish SQL Server User Group
 
How to tune a database application without changing a single query - Maciej P...
How to tune a database application without changing a single query - Maciej P...How to tune a database application without changing a single query - Maciej P...
How to tune a database application without changing a single query - Maciej P...Polish SQL Server User Group
 
Co nowego w SQL Server 11 – Denali CTP1 - Grzegorz Stolecki, Łukasz Grala i K...
Co nowego w SQL Server 11 – Denali CTP1 - Grzegorz Stolecki, Łukasz Grala i K...Co nowego w SQL Server 11 – Denali CTP1 - Grzegorz Stolecki, Łukasz Grala i K...
Co nowego w SQL Server 11 – Denali CTP1 - Grzegorz Stolecki, Łukasz Grala i K...Polish SQL Server User Group
 
Master Data Services – Po co nam kolejna usługa w Sql Server - Mariusz Koprowski
Master Data Services – Po co nam kolejna usługa w Sql Server - Mariusz KoprowskiMaster Data Services – Po co nam kolejna usługa w Sql Server - Mariusz Koprowski
Master Data Services – Po co nam kolejna usługa w Sql Server - Mariusz KoprowskiPolish SQL Server User Group
 

Plus de Polish SQL Server User Group (8)

SQLDay2013_MarcinSzeliga_DataInDataMining
SQLDay2013_MarcinSzeliga_DataInDataMiningSQLDay2013_MarcinSzeliga_DataInDataMining
SQLDay2013_MarcinSzeliga_DataInDataMining
 
26th_Meetup_of_PLSSUG-ColumnStore_Indexes_byBeataZalewa_session
26th_Meetup_of_PLSSUG-ColumnStore_Indexes_byBeataZalewa_session26th_Meetup_of_PLSSUG-ColumnStore_Indexes_byBeataZalewa_session
26th_Meetup_of_PLSSUG-ColumnStore_Indexes_byBeataZalewa_session
 
SQLDay2011_Sesja03_Fakty,MiaryISwiatRealny_GrzegorzStolecki
SQLDay2011_Sesja03_Fakty,MiaryISwiatRealny_GrzegorzStoleckiSQLDay2011_Sesja03_Fakty,MiaryISwiatRealny_GrzegorzStolecki
SQLDay2011_Sesja03_Fakty,MiaryISwiatRealny_GrzegorzStolecki
 
SQLDay2011_Sesja01_ModelowanieIZasilanieWymiarówHurtowniDanych_ŁukaszGrala
SQLDay2011_Sesja01_ModelowanieIZasilanieWymiarówHurtowniDanych_ŁukaszGralaSQLDay2011_Sesja01_ModelowanieIZasilanieWymiarówHurtowniDanych_ŁukaszGrala
SQLDay2011_Sesja01_ModelowanieIZasilanieWymiarówHurtowniDanych_ŁukaszGrala
 
SQLDay2011_Sesja05_MicrosoftSQLServerExecutionPlansFromCompilationToCachingTo...
SQLDay2011_Sesja05_MicrosoftSQLServerExecutionPlansFromCompilationToCachingTo...SQLDay2011_Sesja05_MicrosoftSQLServerExecutionPlansFromCompilationToCachingTo...
SQLDay2011_Sesja05_MicrosoftSQLServerExecutionPlansFromCompilationToCachingTo...
 
How to tune a database application without changing a single query - Maciej P...
How to tune a database application without changing a single query - Maciej P...How to tune a database application without changing a single query - Maciej P...
How to tune a database application without changing a single query - Maciej P...
 
Co nowego w SQL Server 11 – Denali CTP1 - Grzegorz Stolecki, Łukasz Grala i K...
Co nowego w SQL Server 11 – Denali CTP1 - Grzegorz Stolecki, Łukasz Grala i K...Co nowego w SQL Server 11 – Denali CTP1 - Grzegorz Stolecki, Łukasz Grala i K...
Co nowego w SQL Server 11 – Denali CTP1 - Grzegorz Stolecki, Łukasz Grala i K...
 
Master Data Services – Po co nam kolejna usługa w Sql Server - Mariusz Koprowski
Master Data Services – Po co nam kolejna usługa w Sql Server - Mariusz KoprowskiMaster Data Services – Po co nam kolejna usługa w Sql Server - Mariusz Koprowski
Master Data Services – Po co nam kolejna usługa w Sql Server - Mariusz Koprowski
 

Dernier

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesShubhangi Sonawane
 

Dernier (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 

SQLDay2013_ChrisWebb_SSASDesignMistakes

  • 1. NASI SPONSORZY I PARTNERZY
  • 2. (More) Common Analysis Services Multidimensional Design Mistakes and How to Avoid Them Chris Webb
  • 3. Who Am I? • Chris Webb • Email: chris@crossjoin.co.uk • Twitter @Technitrain • • Analysis Services consultant and trainer: www.crossjoin.co.uk & www.technitrain.com Co-author: • MDX Solutions • Expert Cube Development with SSAS 2008 • Analysis Services 2012: The BISM Tabular Model • • SQL Server MVP Blogger: http://cwebbbi.wordpress.com
  • 4. Agenda • • • • • • • • • Why good cube design is a Good Thing Using built-in best practices in BIDS Precon recap Parent/child pain MDX vs modelling Partition elimination Unused and/or unprocessed aggregations NON_EMPTY_BEHAVIOR Cell Security
  • 5. Why Good Design is Important! • As if you needed reasons…? • Good design = good performance = faster initial development = easy further development = simple maintenance • This is not an exhaustive list, but a selection of design problems and mistakes I’ve seen on consultancy engagements
  • 6. Best Practices in BIDS • Don’t ignore the blue squiggly lines in BIDS! – They sometimes make useful recommendations about what you’re doing • Actively dismissing them, with comments, is a useful addition to documentation • As always, official ‘best practices’ aren’t always best practices in all situations
  • 7. Common Design Mistakes • Three questions need to be asked: – What’s the problem? – What bad things will happen as a result? – What can I do to fix it (especially after I’ve gone into production)? • This is not a name-and-shame session!
  • 8. Stuff From My Precon • • • • Don’t use unfriendly names Don’t create unnecessary attributes Don’t do ETL in your DSV Don’t create many small cubes instead of one big one • Don’t create one big cube instead of many smaller ones SQLDay 2013
  • 9. Problem: Parent Child Hierarchies • Parent Child hierarchies are the only way to model hierarchies where you don’t know the number of levels in advance • They are also very flexible, leading some people to use them more often than they should
  • 10. Consequences: Parent Child • Parent Child hierarchies can lead to slow query performance – No aggregations can be built at levels inside the hierarchy – Slow anyway • They can also be a nightmare for – Scoping advanced MDX calculations – Dimension security
  • 11. Fix: Parent Child • If you know, or can assume, the maximum depth of your hierarchy, there’s an alternative • Normal user hierarchies can be made ‘Ragged’ with the HideMemberIf property – Hides members if their parent has no name, or the same name as them • Still has performance issues, but less than parent/child • You can use the BIDS Helper “parent/child naturaliser” to convert the underlying relational table to a level-based structure
  • 12. Problem: Over-reliance on MDX • As with the DSV, it can be tempting to use MDX calculations instead of making structural changes to cubes and dimensions • A simple example is to create a ‘grouping’ calculated member instead of creating a new attribute • Other examples include pivoting measures into a dimension, or doing m2m in MDX
  • 13. Consequences: Over-reliance on MDX • MDX should always be your last resort: • Pure MDX calculations are always going to be the slowest option for query performance • They are also the least-easily maintainable part of a cube • The more complex calculations you have, the more difficult it is to make other calculations work
  • 14. Fix: Over-reliance on MDX • Redesigning your cube is a radical option but can pay big dividends in terms of performance • Risks breaking existing reports and queries but your users may be ok with this to get more speed
  • 15. Problem: Partition Elimination • SSAS will usually only query the partitions that contain the data it needs • This depends on the way it stores the minimum and maximum values of DataIDs (internal keys) in each partition SQLDay 2013
  • 16. Consequences: Partition Elimination • Slow performance – if SSAS queries too many partitions for a single query • Although the extra cache might make future queries faster… SQLDay 2013
  • 17. Fix: Partition Elimination • • • • Rewrite your MDX Set the slice property Order your members by DataID if possible Use the connection string properties Disable Prefetch Cache=True; Cache Ratio=1 SQLDay 2013
  • 18. Problem: Unused Aggregations • Aggregations are the most important SSAS feature for performance • Most people know they need to build some and run the Aggregation Design Wizard… • …but don’t know whether they’re being used or not
  • 19. Consequences: Unused Aggregations • Slow queries! • If you haven’t built the right aggregations, then your queries won’t get any performance benefit • You’ll waste time processing these aggregations, and waste disk space storing them
  • 20. Fix: Unused Aggregations • Design some aggregations! • Rerun the Aggregation Design Wizard and set the Aggregation Usage property appropriately • Perform Usage-Based Optimisation • Design aggregations manually for queries that are still slow and could benefit from aggregations
  • 21. Problem: Unprocessed Aggregations • Even if you’ve designed aggregations that are useful for your queries, you need to ensure they’re processed • Running a Process Update on a dimension will drop some or all Flexible aggregations (depends on which version of SSAS)
  • 23. Fix: Unprocessed Aggregations • Run a Process Default or a Process Index on your cube after you have run a Process Update on any dimensions • Note that this will result in: – Longer processing times overall – More disk space used • But it will at least mean that your queries run faster
  • 24. Problem: Non_Empty_Behavior • The Non_Empty_Behavior property was introduced in SSAS 2000 as a performance hint • It was very important in SSAS 2000/2005 • It says: If Regular Measure A is Null Then Calculated Measure B will be Null • But it is usually set incorrectly • And from SSAS 2008 on it is mostly unnecessary SQLDay 2013
  • 25. Consequences: Non_Empty_Behavior • Setting Non_Empty_Behavior incorrectly can – At best, make no difference to your performance – At worst, result in incorrect query results SQLDay 2013
  • 26. Fix: Non_Empty_Behavior • Don’t set it! • Rewrite your calculations to check for null values: IIF( ISEMPTY(MEASURES.A), NULL, <CALCULATION> ) SQLDay 2013
  • 27. Problem: Cell Security • Cell security allows you to secure individual cells in a cube • At first sight, it is the only option: it does things dimension security cannot do… SQLDay 2013
  • 28. Consequences: Cell Security • Setting cell security correctly can be very difficult • Read and read contingent cell security can be even more confusing • Performance is often very bad with cell security: – Forces cell-by-cell mode – Forces Formula Engine caching to query scope SQLDay 2013
  • 29. Fix: Cell Security • The answer is to use Dimension Security instead • But how…? • Create a new dimension that contains the combinations of members that you want to secure • Then use Dimension Security on it • Doesn’t work if you need to secure measures  SQLDay 2013
  • 31. NASI SPONSORZY I PARTNERZY Organizacja: Polskie Stowarzyszenie Użytkowników SQL Server - PLSSUG Produkcja: DATA MASTER Maciej Pilecki