SlideShare una empresa de Scribd logo
1 de 15
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

Building solutions with the SharePoint Framework - introduction
Building solutions with the SharePoint Framework - introductionBuilding solutions with the SharePoint Framework - introduction
Building solutions with the SharePoint Framework - introductionWaldek Mastykarz
 
饿了么工作流介绍
饿了么工作流介绍饿了么工作流介绍
饿了么工作流介绍Zhongke Chen
 
Trivadis TechEvent 2017 Tools and Methods for DB Migrations by Kim Berg Hansen
Trivadis TechEvent 2017 Tools and Methods for DB Migrations by Kim Berg HansenTrivadis TechEvent 2017 Tools and Methods for DB Migrations by Kim Berg Hansen
Trivadis TechEvent 2017 Tools and Methods for DB Migrations by Kim Berg HansenTrivadis
 
Visualize your graph database
Visualize your graph databaseVisualize your graph database
Visualize your graph databaseMichael Hackstein
 
Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012Exciting Features for SQL Devs in SQL 2012
Exciting Features for SQL Devs in SQL 2012Brij Mishra
 
Grokking TechTalk #16: Html js and three way binding
Grokking TechTalk #16: Html js and three way bindingGrokking TechTalk #16: Html js and three way binding
Grokking TechTalk #16: Html js and three way bindingGrokking VN
 
Building Read Models using event streams
Building Read Models using event streamsBuilding Read Models using event streams
Building Read Models using event streamsDenis Ivanov
 
The journey of Moving from AWS ELK to GCP Data Pipeline
The journey of Moving from AWS ELK to GCP Data PipelineThe journey of Moving from AWS ELK to GCP Data Pipeline
The journey of Moving from AWS ELK to GCP Data PipelineRandy Huang
 
Real-Time Vote Platform Benchmark
Real-Time Vote Platform BenchmarkReal-Time Vote Platform Benchmark
Real-Time Vote Platform BenchmarkLahav Savir
 
DB multi tenancy with Rails 6
DB multi tenancy with Rails 6DB multi tenancy with Rails 6
DB multi tenancy with Rails 6João Fernandes
 
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...Дмитрий Тежельников  «Разработка вэб-решений с использованием Asp.NET.Core и ...
Дмитрий Тежельников «Разработка вэб-решений с использованием Asp.NET.Core и ...MskDotNet Community
 
CosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersCosmosDB for DBAs & Developers
CosmosDB for DBAs & DevelopersNiko Neugebauer
 

La actualidad más candente (20)

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

Destacado

Tο ταξίδι του σπόρου
Tο ταξίδι του σπόρου Tο ταξίδι του σπόρου
Tο ταξίδι του σπόρου olsakella
 
CV_Audrey_Robertson_english (4)
CV_Audrey_Robertson_english (4)CV_Audrey_Robertson_english (4)
CV_Audrey_Robertson_english (4)Audrey Robertson
 
Australian Administrative Law Policy Guide
Australian Administrative Law Policy GuideAustralian Administrative Law Policy Guide
Australian Administrative Law Policy GuideErin Pynor
 
雷の波形は指数関数(フォローアッププログラムクラス講義07072016)
雷の波形は指数関数(フォローアッププログラムクラス講義07072016)雷の波形は指数関数(フォローアッププログラムクラス講義07072016)
雷の波形は指数関数(フォローアッププログラムクラス講義07072016)Hideo Hirose
 
T 1 que es la ciencia versión 2
T 1 que es la ciencia versión 2T 1 que es la ciencia versión 2
T 1 que es la ciencia versión 2Jordi Coronado
 
Senacip discours du ministre de l'unité nationale et de la citoyenneté
Senacip discours du ministre de l'unité nationale et de la citoyennetéSenacip discours du ministre de l'unité nationale et de la citoyenneté
Senacip discours du ministre de l'unité nationale et de la citoyennetéFatoumata Chérif
 
Snsnews 201607
Snsnews 201607Snsnews 201607
Snsnews 201607AAsolution
 
Maunaloa co2 trend prediction using R
Maunaloa co2 trend prediction using RMaunaloa co2 trend prediction using R
Maunaloa co2 trend prediction using RHideo Hirose
 
RESUME DU GUIDE DES NEGOCIATIONS POUR LA COP 12
RESUME DU GUIDE DES NEGOCIATIONS POUR LA COP 12 RESUME DU GUIDE DES NEGOCIATIONS POUR LA COP 12
RESUME DU GUIDE DES NEGOCIATIONS POUR LA COP 12 Fatoumata Chérif
 
Mahomet et ses "Amis"
Mahomet et ses "Amis"Mahomet et ses "Amis"
Mahomet et ses "Amis"CrossMuslims
 
German mining industry overview 2014 final
German mining industry overview 2014 finalGerman mining industry overview 2014 final
German mining industry overview 2014 finalmartin dr. Wedig
 
A importância da eletricidade nas nossas vidas
A importância da eletricidade nas nossas vidasA importância da eletricidade nas nossas vidas
A importância da eletricidade nas nossas vidasnanasimao
 
Quimica Organica 2ed Allinger Cava
Quimica Organica  2ed  Allinger CavaQuimica Organica  2ed  Allinger Cava
Quimica Organica 2ed Allinger CavaXTemplaryus
 
Meiosis y gametogénesis
Meiosis y gametogénesisMeiosis y gametogénesis
Meiosis y gametogénesisNora Besso
 

Destacado (18)

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

Similar a High Performance SSRS

High Performance SSRS
High Performance SSRSHigh Performance SSRS
High Performance SSRSBert Wagner
 
MySQL Performance Schema in Action
MySQL Performance Schema in Action MySQL Performance Schema in Action
MySQL Performance Schema in Action Mydbops
 
SQL Server Reporting Services (SSRS) 101
 SQL Server Reporting Services (SSRS) 101 SQL Server Reporting Services (SSRS) 101
SQL Server Reporting Services (SSRS) 101Sparkhound Inc.
 
Tips tricks to speed nw bi 2009
Tips tricks to speed  nw bi  2009Tips tricks to speed  nw bi  2009
Tips tricks to speed nw bi 2009HawaDia
 
Geek Sync | Top Metrics to Monitor in Your MySQL Databases
Geek Sync | Top Metrics to Monitor in Your MySQL DatabasesGeek Sync | Top Metrics to Monitor in Your MySQL Databases
Geek Sync | Top Metrics to Monitor in Your MySQL DatabasesIDERA Software
 
Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the fieldJoAnna Cheshire
 
PHP Detroit -- MySQL 8 A New Beginning (updated presentation)
PHP Detroit -- MySQL 8 A New Beginning (updated presentation)PHP Detroit -- MySQL 8 A New Beginning (updated presentation)
PHP Detroit -- MySQL 8 A New Beginning (updated presentation)Dave Stokes
 
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...Dave Stokes
 
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan InstabilityLVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan InstabilityMaris Elsins
 
SharePoint Troubleshooting
SharePoint TroubleshootingSharePoint Troubleshooting
SharePoint TroubleshootingToby McGrail
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mydbops
 
Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...
Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...
Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...Data Con LA
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersTobias Koprowski
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersTobias Koprowski
 
Database in Microservices - (2nd PostgreSQL Conference Nepal 2023)
Database in Microservices - (2nd PostgreSQL Conference Nepal 2023)Database in Microservices - (2nd PostgreSQL Conference Nepal 2023)
Database in Microservices - (2nd PostgreSQL Conference Nepal 2023)Sandip Basnet
 
OSMC 2019 | How to improve database Observability by Charles Judith
OSMC 2019 | How to improve database Observability by Charles JudithOSMC 2019 | How to improve database Observability by Charles Judith
OSMC 2019 | How to improve database Observability by Charles JudithNETWAYS
 
Why & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryWhy & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryAntonios Chatzipavlis
 
My sql cluster case study apr16
My sql cluster case study apr16My sql cluster case study apr16
My sql cluster case study apr16Sumi Ryu
 

Similar a High Performance SSRS (20)

High Performance SSRS
High Performance SSRSHigh Performance SSRS
High Performance SSRS
 
MySQL Performance Schema in Action
MySQL Performance Schema in Action MySQL Performance Schema in Action
MySQL Performance Schema in Action
 
SQL Server Reporting Services (SSRS) 101
 SQL Server Reporting Services (SSRS) 101 SQL Server Reporting Services (SSRS) 101
SQL Server Reporting Services (SSRS) 101
 
Tips tricks to speed nw bi 2009
Tips tricks to speed  nw bi  2009Tips tricks to speed  nw bi  2009
Tips tricks to speed nw bi 2009
 
Geek Sync | Top Metrics to Monitor in Your MySQL Databases
Geek Sync | Top Metrics to Monitor in Your MySQL DatabasesGeek Sync | Top Metrics to Monitor in Your MySQL Databases
Geek Sync | Top Metrics to Monitor in Your MySQL Databases
 
Sql good practices
Sql good practicesSql good practices
Sql good practices
 
Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the field
 
PHP Detroit -- MySQL 8 A New Beginning (updated presentation)
PHP Detroit -- MySQL 8 A New Beginning (updated presentation)PHP Detroit -- MySQL 8 A New Beginning (updated presentation)
PHP Detroit -- MySQL 8 A New Beginning (updated presentation)
 
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
PHP UK 2020 Tutorial: MySQL Indexes, Histograms And other ways To Speed Up Yo...
 
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan InstabilityLVOUG meetup #2 - Forcing SQL Execution Plan Instability
LVOUG meetup #2 - Forcing SQL Execution Plan Instability
 
SharePoint Troubleshooting
SharePoint TroubleshootingSharePoint Troubleshooting
SharePoint Troubleshooting
 
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
Mastering MongoDB Atlas: Essentials of Diagnostics and Debugging in the Cloud...
 
Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...
Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...
Data Con LA 2018 - Enabling real-time exploration and analytics at scale at H...
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
 
Database in Microservices - (2nd PostgreSQL Conference Nepal 2023)
Database in Microservices - (2nd PostgreSQL Conference Nepal 2023)Database in Microservices - (2nd PostgreSQL Conference Nepal 2023)
Database in Microservices - (2nd PostgreSQL Conference Nepal 2023)
 
OSMC 2019 | How to improve database Observability by Charles Judith
OSMC 2019 | How to improve database Observability by Charles JudithOSMC 2019 | How to improve database Observability by Charles Judith
OSMC 2019 | How to improve database Observability by Charles Judith
 
Breaking data
Breaking dataBreaking data
Breaking data
 
Why & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to queryWhy & how to optimize sql server for performance from design to query
Why & how to optimize sql server for performance from design to query
 
My sql cluster case study apr16
My sql cluster case study apr16My sql cluster case study apr16
My sql cluster case study apr16
 

Último

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

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

Notas del editor

  1. Take a screenshot!
  2. Slow loading means Bad user experience Server stress
  3. Make sure to SET NOCOUNT ON
  4. Some scenarios, the SQL and SSRS server are the same machine
  5. 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!
  6. Combine with previous? IF/THEN WITH RECOMPILE
  7. 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?
  8. MAke usre all subreports don’t run