SlideShare a Scribd company logo
High Performance SSRS:
Lessons Learned
GroupBy | Bert Wagner | January 13, 2017
2
These are our enemies!
Background
● BI developer at Progressive Insurance for 6+ years
● Primarily SQL 2008, 2012
● Will be using StackOverflow data dump
● Slide, demos, code is available on GroupBy.org and
bertwagner.com
3
Overview
1. SSRS Usage Data
2. SELECT *
3. Traffic and Specialization
4. Multivalue Parameters
5. Dealing with Parameter Sniffing
6. Explicitly Defining Property Values
7. Stored Procedure CRUD Operations
8. Dynamic SQL
9. Subreport Switching
denotes demo in SSRS/SQL
4
1. SSRS Usage Data
● Important to be able to measure results
○ Only way to solve “it depends” answers
● SSRS database has built in logging for analysis
○ https://msdn.microsoft.com/en-us/library/ms159110.aspx
● Most useful metrics to look at when measuring performance:
○ Time Data Retrieval - time getting the data for report
○ Time Processing - time manipulating the data in report (sort, filter,
etc…)
○ Time Rendering - time to build the report in the chose render
format (HTML, Excel, PDF, etc…)
5
2. SELECT *
● Brings back more data than you actually need
● Indexes suffer/hope you like table scans
● Maintainability - new columns might force changes in datasets
○ Duplicate column names might break reports
○ Overtime extra columns might be brought in that aren’t needed
● Doesn’t tell future developers anything about intentions
6
3. Traffic and Specialization
SQL
Database
SSRS
Server
User’s
Computer
Scenario #1: No work in the query, lots of work in the report. Work
includes filtering, sorting, etc…
7
3. Traffic and Specialization
SQL
Database
SSRS
Server
User’s
Computer
Scenario #2: Filtering, sorting in the query, reporting server just displays
the page to the user
● No filtering in the dataset
● No sorting in the tablix
8
4. Multivalue Parameters
9
● Multivalue parameters can be handled multiple different ways
○ Some are more performant than others!
5. Dealing with Parameter Sniffing
10
● Parameter sniffing occurs when differing values in the input parameters
cause a sub-optimal execution plan to be chosen
● Due to the nature of SSRS report parameters, parameter sniffing is a
common problem
● Solutions:
○ WITH RECOMPILE
○ OPTION (RECOMPILE)
○ OPTIMIZE FOR
○ IF/THEN
6. Explicitly Defining Property Values
11
● Any report properties not explicitly defined during render have to
determined by SSRS during the processing and render steps.
● Explicitly define properties like:
○ Text alignment (don’t use General)
● Some properties have to do lots of calculating which hurts performance:
○ AutoGrow, AutoShrink
○ Image AutoSize
A full list of properties and considerations can be found here:
https://technet.microsoft.com/en-us/library/bb522806(v=sql.105).aspx?f=255&
MSPPError=-2147217396#Render
7. Stored Procedure CRUD Operations
12
● It is possible to INSERT/UPDATE/DELETE on the database from an
SSRS report
○ Can actually do anything that a stored procedure will allow
● There are a few things we exploit to get this to work:
○ Datasets in a report always execute - even if they call a stored
procedure that inserts/updates/deletes and returns no data
○ If the data source’s “single transaction” property is enabled, datasets
will execute in the order they appear
8. Dynamic SQL
13
● Dynamic SQL is a query that is built
programmatically
○ This gives us lots of flexibility in
terms of how we can display our
data and build reports so they are
reusable
● Dynamic SQL can run very efficiently or
have terrible performance - use caution
and ALWAYS test
● Dynamic SQL also leaves lots of room
open for SQL injection - be sure to
parameterize any user input you are
building into your query
9. Subreport Switching
14
● Reports with lots of expressions
generally take a long time to render
● If a report is using a lot of
expressions, it’s sometimes possible
to break them up into multiple
subreports
○ The parent report decides which
subreport to run (based on
efficiency)
○ This comes up a lot if you are
displaying data using dynamic
SQL
Thank you!
● Session: https://GroupBy.org/go/session6
● Blog: https://bertwagner.com
● Email: bertwagner@bertwagner.com
● Twitter: @bertwagner
15

More Related Content

PPTX
JSON in SQL Server 2016
PPTX
DBAs vs Developers: JSON in SQL Server
PDF
Json usage and performance in sql server 2016
PPTX
DBAs vs Developers - JSON in SQL Server
PDF
WEBridge 4 SAP ( Windchill and SAP Integration)
PDF
WEBridge 4 EBS ( Windchill and Oracle EBS Integration )
PPTX
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
PPTX
Building solutions with the SharePoint Framework - deep-dive
JSON in SQL Server 2016
DBAs vs Developers: JSON in SQL Server
Json usage and performance in sql server 2016
DBAs vs Developers - JSON in SQL Server
WEBridge 4 SAP ( Windchill and SAP Integration)
WEBridge 4 EBS ( Windchill and Oracle EBS Integration )
Deep Dive building solutions on the SharePoint Framework - SPS Brussels 2016
Building solutions with the SharePoint Framework - deep-dive

What's hot (20)

PPTX
Introduction presentation
PPTX
Mvc razor and working with data
PPTX
Web forms Overview Presentation
PPTX
Building solutions with the SharePoint Framework - introduction
PPTX
ASP.NET MVC overview
PDF
饿了么工作流介绍
PPS
WEBridge 4 SAP R 1.0
PDF
Trivadis TechEvent 2017 Tools and Methods for DB Migrations by Kim Berg Hansen
PDF
Visualize your graph database
PDF
MongoDB vs OrientDB
PPTX
Exciting Features for SQL Devs in SQL 2012
PPTX
Grokking TechTalk #16: Html js and three way binding
PDF
Building Read Models using event streams
PDF
The journey of Moving from AWS ELK to GCP Data Pipeline
PDF
Real-Time Vote Platform Benchmark
PDF
Apache Gobblin
PPTX
DB multi tenancy with Rails 6
PPTX
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
PDF
Async streams
PDF
CosmosDB for DBAs & Developers
Introduction presentation
Mvc razor and working with data
Web forms Overview Presentation
Building solutions with the SharePoint Framework - introduction
ASP.NET MVC overview
饿了么工作流介绍
WEBridge 4 SAP R 1.0
Trivadis TechEvent 2017 Tools and Methods for DB Migrations by Kim Berg Hansen
Visualize your graph database
MongoDB vs OrientDB
Exciting Features for SQL Devs in SQL 2012
Grokking TechTalk #16: Html js and three way binding
Building Read Models using event streams
The journey of Moving from AWS ELK to GCP Data Pipeline
Real-Time Vote Platform Benchmark
Apache Gobblin
DB multi tenancy with Rails 6
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Async streams
CosmosDB for DBAs & Developers
Ad

Viewers also liked (18)

PPTX
Tο ταξίδι του σπόρου
DOCX
CV_Audrey_Robertson_english (4)
DOC
Practica nº 02(densidad)
PDF
Australian Administrative Law Policy Guide
PDF
1/2+1/3=2/5
PDF
雷の波形は指数関数(フォローアッププログラムクラス講義07072016)
PPT
T 1 que es la ciencia versión 2
PDF
Senacip discours du ministre de l'unité nationale et de la citoyenneté
PDF
Snsnews 201607
PDF
Maunaloa co2 trend prediction using R
PDF
RESUME DU GUIDE DES NEGOCIATIONS POUR LA COP 12
DOC
Mahomet et ses "Amis"
PDF
German mining industry overview 2014 final
PDF
Sindromes
PPT
A importância da eletricidade nas nossas vidas
PDF
Quimica Organica 2ed Allinger Cava
PDF
Meiosis y gametogénesis
PDF
Espacios de trabajo ágiles
Tο ταξίδι του σπόρου
CV_Audrey_Robertson_english (4)
Practica nº 02(densidad)
Australian Administrative Law Policy Guide
1/2+1/3=2/5
雷の波形は指数関数(フォローアッププログラムクラス講義07072016)
T 1 que es la ciencia versión 2
Senacip discours du ministre de l'unité nationale et de la citoyenneté
Snsnews 201607
Maunaloa co2 trend prediction using R
RESUME DU GUIDE DES NEGOCIATIONS POUR LA COP 12
Mahomet et ses "Amis"
German mining industry overview 2014 final
Sindromes
A importância da eletricidade nas nossas vidas
Quimica Organica 2ed Allinger Cava
Meiosis y gametogénesis
Espacios de trabajo ágiles
Ad

Similar to High Performance SSRS (20)

PPTX
High Performance SSRS
PPTX
SQL Server Reporting Services (SSRS) 101
PPT
Netvu test slideshow
PPTX
SQL Server Reporting Services Training
PDF
SQL Server 2005 Reporting Services in Action 1 / Rev. ed Edition Bret Updegraff
DOCX
REPORT ON (1)
PDF
SQL Server 2005 Reporting Services in Action 1 / Rev. ed Edition Bret Updegraff
PPT
Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2
PPT
Ssrs 2005 Reporting Services
PDF
Sql Server 2005 Reporting Services In Action 1 Rev Ed Bret Updegraff
PPTX
Agile Methodology Approach to SSRS Reporting
PDF
Professional Microsoft SQL Server 2016 Reporting Services and Mobile Reports ...
PDF
MSBI-SQL Server Reporting Services
PPTX
Ssn#14 reporting services part ii
PPTX
PDF
Microsoft Reporting Services in Action 1st Edition Teo Lachev
PPT
SQL Reporting Services
PPTX
Ssrs 2008 R2 webinar
PDF
Business Intelligence Technology Presentation
PPTX
Presentation 1 - SSRS (1)
High Performance SSRS
SQL Server Reporting Services (SSRS) 101
Netvu test slideshow
SQL Server Reporting Services Training
SQL Server 2005 Reporting Services in Action 1 / Rev. ed Edition Bret Updegraff
REPORT ON (1)
SQL Server 2005 Reporting Services in Action 1 / Rev. ed Edition Bret Updegraff
Basics & Intro to SQL Server Reporting Services: Sql Server Ssrs 2008 R2
Ssrs 2005 Reporting Services
Sql Server 2005 Reporting Services In Action 1 Rev Ed Bret Updegraff
Agile Methodology Approach to SSRS Reporting
Professional Microsoft SQL Server 2016 Reporting Services and Mobile Reports ...
MSBI-SQL Server Reporting Services
Ssn#14 reporting services part ii
Microsoft Reporting Services in Action 1st Edition Teo Lachev
SQL Reporting Services
Ssrs 2008 R2 webinar
Business Intelligence Technology Presentation
Presentation 1 - SSRS (1)

Recently uploaded (20)

PPTX
1. Introduction to Computer Programming.pptx
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Big Data Technologies - Introduction.pptx
PDF
Getting Started with Data Integration: FME Form 101
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Tartificialntelligence_presentation.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Electronic commerce courselecture one. Pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
1. Introduction to Computer Programming.pptx
Mobile App Security Testing_ A Comprehensive Guide.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
Unlocking AI with Model Context Protocol (MCP)
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Advanced methodologies resolving dimensionality complications for autism neur...
Spectral efficient network and resource selection model in 5G networks
Big Data Technologies - Introduction.pptx
Getting Started with Data Integration: FME Form 101
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Tartificialntelligence_presentation.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Group 1 Presentation -Planning and Decision Making .pptx
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Electronic commerce courselecture one. Pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation

High Performance SSRS

  • 1. High Performance SSRS: Lessons Learned GroupBy | Bert Wagner | January 13, 2017
  • 2. 2 These are our enemies!
  • 3. Background ● BI developer at Progressive Insurance for 6+ years ● Primarily SQL 2008, 2012 ● Will be using StackOverflow data dump ● Slide, demos, code is available on GroupBy.org and bertwagner.com 3
  • 4. Overview 1. SSRS Usage Data 2. SELECT * 3. Traffic and Specialization 4. Multivalue Parameters 5. Dealing with Parameter Sniffing 6. Explicitly Defining Property Values 7. Stored Procedure CRUD Operations 8. Dynamic SQL 9. Subreport Switching denotes demo in SSRS/SQL 4
  • 5. 1. SSRS Usage Data ● Important to be able to measure results ○ Only way to solve “it depends” answers ● SSRS database has built in logging for analysis ○ https://msdn.microsoft.com/en-us/library/ms159110.aspx ● Most useful metrics to look at when measuring performance: ○ Time Data Retrieval - time getting the data for report ○ Time Processing - time manipulating the data in report (sort, filter, etc…) ○ Time Rendering - time to build the report in the chose render format (HTML, Excel, PDF, etc…) 5
  • 6. 2. SELECT * ● Brings back more data than you actually need ● Indexes suffer/hope you like table scans ● Maintainability - new columns might force changes in datasets ○ Duplicate column names might break reports ○ Overtime extra columns might be brought in that aren’t needed ● Doesn’t tell future developers anything about intentions 6
  • 7. 3. Traffic and Specialization SQL Database SSRS Server User’s Computer Scenario #1: No work in the query, lots of work in the report. Work includes filtering, sorting, etc… 7
  • 8. 3. Traffic and Specialization SQL Database SSRS Server User’s Computer Scenario #2: Filtering, sorting in the query, reporting server just displays the page to the user ● No filtering in the dataset ● No sorting in the tablix 8
  • 9. 4. Multivalue Parameters 9 ● Multivalue parameters can be handled multiple different ways ○ Some are more performant than others!
  • 10. 5. Dealing with Parameter Sniffing 10 ● Parameter sniffing occurs when differing values in the input parameters cause a sub-optimal execution plan to be chosen ● Due to the nature of SSRS report parameters, parameter sniffing is a common problem ● Solutions: ○ WITH RECOMPILE ○ OPTION (RECOMPILE) ○ OPTIMIZE FOR ○ IF/THEN
  • 11. 6. Explicitly Defining Property Values 11 ● Any report properties not explicitly defined during render have to determined by SSRS during the processing and render steps. ● Explicitly define properties like: ○ Text alignment (don’t use General) ● Some properties have to do lots of calculating which hurts performance: ○ AutoGrow, AutoShrink ○ Image AutoSize A full list of properties and considerations can be found here: https://technet.microsoft.com/en-us/library/bb522806(v=sql.105).aspx?f=255& MSPPError=-2147217396#Render
  • 12. 7. Stored Procedure CRUD Operations 12 ● It is possible to INSERT/UPDATE/DELETE on the database from an SSRS report ○ Can actually do anything that a stored procedure will allow ● There are a few things we exploit to get this to work: ○ Datasets in a report always execute - even if they call a stored procedure that inserts/updates/deletes and returns no data ○ If the data source’s “single transaction” property is enabled, datasets will execute in the order they appear
  • 13. 8. Dynamic SQL 13 ● Dynamic SQL is a query that is built programmatically ○ This gives us lots of flexibility in terms of how we can display our data and build reports so they are reusable ● Dynamic SQL can run very efficiently or have terrible performance - use caution and ALWAYS test ● Dynamic SQL also leaves lots of room open for SQL injection - be sure to parameterize any user input you are building into your query
  • 14. 9. Subreport Switching 14 ● Reports with lots of expressions generally take a long time to render ● If a report is using a lot of expressions, it’s sometimes possible to break them up into multiple subreports ○ The parent report decides which subreport to run (based on efficiency) ○ This comes up a lot if you are displaying data using dynamic SQL
  • 15. Thank you! ● Session: https://GroupBy.org/go/session6 ● Blog: https://bertwagner.com ● Email: bertwagner@bertwagner.com ● Twitter: @bertwagner 15

Editor's Notes

  • #2: Take a screenshot!
  • #3: Slow loading means Bad user experience Server stress
  • #7: Make sure to SET NOCOUNT ON
  • #8: Some scenarios, the SQL and SSRS server are the same machine
  • #10: Check if 2008, 2012 need join(). 2016 doesn’t Older versions need to use JOIN() on your multivalue parameter if sending to a USP. 2016 doesn’t need it!
  • #11: Combine with previous? IF/THEN WITH RECOMPILE
  • #12: Defining page breaks, setting expressions in header/footer (whole thing has to render), subreports in tablix, anthing that’s RBAR Maybe do a demo slide comparison of this?
  • #15: MAke usre all subreports don’t run