SQLSat - Processing - Tabular - Models 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Processing Tabular Models

{
"refresh": {
"type": "automatic",
"objects": [
{
"database": "SQLSaturday"
}
]
}
}

Bill Anton
Bill Anton
SSAS / Power BI Consultant
www.opifexsolutions.com

[email protected]
@SQLbyoBI

Downloads and additional references:


https://github.com/byobi/SQLSat_TabularProcessing
Agenda
• Architecture
• Tabular Data Structures 101
• Processing Options
• Performance
• Common Strategies
TRUE() = NOT( Agenda )
• SSAS Multidimensional (dead product, convince me otherwise!)
• Power BI Incremental Processing
• Pie Charts
• R.O.U.S.
Architecture
Architectures
On-Premise Hybrid Cloud

Analysis Service

Azure SQL DW

SQL Server
Analysis Service
(on-premise)
(on-premise) Data Gateway Azure SQL DB Analysis Service

Storage blob
SQL Server
(on-premise)
Tabular Object Model

Database

Model

Table A Table B

Column A Column B Column A Column B


Tabular Data Structures 101
• Dictionary
• 1 per column
• Value vs Hash
• Partition
• At least 1 per table (standard vs enterprise)
• made up of 1 or more segments
• Segment
• a “chunk” of rows (default: 8mm**)
• Configurable at the instance-level
• Calculated Columns (and Tables)
• Stored like regular columns (but not compressed)
• Good or bad?
• Hierarchy
• Can improve query performance
• Relationship
• Optimizes lookups & filtering across tables (i.e. “table
expansion”)
Processing Commands
Command Description
ProcessDefault processes any objects (tables, partitions, etc) that are currently
in an unprocessed
ProcessFull ProcessData + ProcessRecalc
ProcessData reads data from source and builds compressed dictionaries
and partition segments
ProcessRecalc builds any calculated columns, calculated tables, hierarchies,
and/or relationships that need to be rebuilt.
ProcessAdd appends new data to existing data + ProcessRecalc
ProcessClear empties all data from the model
ProcessDefrag Rebuilds dictionaries to clear out values that no longer exist
Demo 00: ProcessDefault
Does the least amount of work needed to bring the model to a “query-able” state

{
"refresh": {
"type": "automatic",
"objects": [
{
"database": "AdventureWorks"
}
]
}
}
Phases of Processing
- Open connection
- Execute SQL
- Encoding
- Compression
- ProcessRecalc
Processing Phases

Source: https://channel9.msdn.com/Events/TechEd/Europe/2014/DBI-B414
Segment = 8 million rows (default) Source: https://channel9.msdn.com/Events/TechEd/Australia/2012/DBI315
Parallel Processing
Parallel Processing (the correct way)

ProcessData ProcessRecalc
Demo 01: ProcessRecalc
Builds any calculated columns, calculated tables, hierarchies, and/or relationships that needs to
be rebuilt.

{
"refresh": {
"type": "calculate",
"objects": [
{
"database": "AdventureWorks"
}
]
}
}
Common Processing Strategies
• ProcessFull at the database level
• Pros: simple, data remains available for queries
• Cons: requires most memory

• ProcessClear + ProcessFull (separate transactions!!)


• Pros: simple
• Cons: database will be offline for however long it takes to complete ProcessFull

• Incremental Processing (many flavors)


• Pros: quick (can be “near” real-time)
• Cons: complicated, Enterprise Edition (or Standard SKU)
Less Common Strategies
• ProcessAdd
• Pros: very fast, minimal memory overhead
• Cons: very complicated to implement (e.g. Journalized tables, out-of-line binding)

• Model Flipping
• Pros: low latency
• Cons: complicated and expensive
Performance Considerations
• Processing is resource intensive (CPU, Memory)
• Balance is key!
• Throughput vs Resource Constraints
• Intra-day Processing or Overnight?
• Don’t forget to tune the source
• Use Perfmon and Extended Events to Monitor
(or purchase BI Sentry or BI Manager)
Additional Resources
Performance Tuning of Tabular Models in SQL Server 2012 Analysis Services
https://blogs.msdn.microsoft.com/karang/2013/08/02/sql-2012-tabular-performance-tuning-of-
tabular-models-in-sql-server-2012-analysis-services/

Refresh Command (TMSL)


https://docs.microsoft.com/en-us/sql/analysis-services/tabular-models-scripting-language-
commands/refresh-command-tmsl?view=sql-analysis-services-2017

As Partition Processing (Whitepaper + Code)


https://github.com/Microsoft/Analysis-Services/tree/master/AsPartitionProcessing

Performance Monitoring (DIY)


http://byobi.com/2016/02/performance-monitoring-for-ssas-extended-events-cheat-sheet/
http://byobi.com/2016/03/performance-monitoring-for-ssas-perfmon-counter-cheat-sheet/

You might also like