SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
High Performance SSRS:
Techniques for Fast Reporting
| Bert Wagner | February 3, 2018
1
Objective
• Eliminate these (or at least reduce their time on screen)
• i.e. make your reports fast
2
Background
• Business Intelligence Developer @ Progressive Insurance
• SSRS, SSIS, SQL, .NET, API, IoT, LOL, ROFL, and LMAO…
• I like making things go fast
Demo code and slides available at bertwagner.com
Will be using StackOverflow data dump
3
There are 3 main things you can do:
• SQL solutions
• Reporting solutions
• Hybrid special case solutions
SSRS Performance Tuning
4
Part 1: SQL Solutions
5
Audience Participation:
Which interval
is longer?
Photo by Abigail Lynn on Unsplash
The audience during my last SSRS presentation
6
SQL Solutions: SSRS Usage Data
● You need a baseline for performance testing!
● SSRS database has built in logging for analysis
○ https://msdn.microsoft.com/en-us/library/ms159110.aspx
○ Use the “ExecutionLog3” view
● 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…)
7
Audience Participation:
Which is the right tool?
“Toy Pail and Shovel" by Kelly D Photography is licensed under CC BY-NC 2.0
“Construction Equipment” by Dimitriy is licensed under CC BY-NC 2.0
8
Audience Participation:
Which is the right tool?
“Sand Castles" by Dave Gunn is licensed under CC BY-NC 2.0
“A Hole In The Ground" by Jitze Couperus is licensed under CC BY 2.0
9
SQL Solutions: Tool 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…
10
Demo
SQL Solutions: Tool 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
11
Demo
SQL Solutions: Disk IO, Network IO
a.k.a. Don’t use SELECT *
Using SELECT *:
● Returns more data than is needed
● Affects read time off disk
● Fills buffer pool
● Affects time spent on the network
● Prevents smaller, data dense indexes from being used
● Could impact SARGABILITY – indexes might not be used
to filter data, table scan instead
● Could break queries/reports
● Gives no hints to future developers about intentions
Photo by Brooke Lark on Unsplash
12
SQL Solutions: Parameter Sniffing
“Sometimes my report runs fast, other times slow”
• It’s a feature!
• Allows SQL Server to cache and reuse plans
• Doesn’t work well if your data is skewed
• Problematic if different parameter values should produce
drastically different execution plans
Photo by Amanda Kerr on Unsplash
13
Solutions:
• RECOMPILE
• OPTIMIZE FOR
• IF/THEN
• Additional information:
https://bertwagner.com/2017/08/08/why-parameter-
sniffing-isnt-always-a-bad-thing-but-usually-is/
Demo
Part 2: SSRS Solutions
14
Audience Participation:
Spot the difference?
15
Photo by Gabriel Sanchez on UnsplashPhoto by Gabriel Sanchez on Unsplash
16
Photo by Gabriel Sanchez on UnsplashPhoto by Gabriel Sanchez on Unsplash
SSRS Solutions: Compress Images
GIF 74 KB JPG 5.44 MB
SSRS will not compress your images. Reduce network IO and compress them yourself!
SSRS Solutions: Explicitly Define
Property Values
17
● 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
Photo by Dawid Małecki on Unsplash
SSRS Solutions: Don’t Render HTML
• Rendering HTML reports is relatively expensive
• Other options, like Excel, perform significantly faster
• E.g. add &rs:Format=EXCELOPENXML to end of URL
• Available formats found in your config file
• Use EXCELOPENXML instead of default EXCEL to force
the newer (smaller) version of Excel (applies to older
versions of SSRS)
18
SSRS Solutions: Caching and Snapshots
• SSRS can cache reports if data (parameters!) don’t change
• Data warehouse refreshed overnight? Don’t requery
all day long
• First person queries live, the rest get the cached copy
• Can also schedule Snapshots
• The results of a query at a specific time
• Can schedule for certain times allowing all users
(including the first) to receive snapshotted data
19
More information: https://docs.microsoft.com/en-
us/sql/reporting-services/report-server/preload-the-
cache-report-manager
Part 3: Hybrid Solutions
20
Hybrid Solutions: CRUD Operations
21
● 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
Photo by Mr Cup / Fabien Barral on Unsplash
Demo
Hybrid Solutions: Dynamic SQL
22
● 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
● Further info about SQL injection:
https://bertwagner.com/2017/08/29/warning-are-your-queries-
vulnerable-to-sql-injection/
Photo by Timothy Simon on Unsplash
Demo
Hybrid Solutions: Subreport Switching
23
● 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
Photo by Natalia Y on Unsplash
Demo
1. SQL Solutions
• SSRS Usage Data
• Tool Specialization
• Disk IO, Network IO
• Parameter Sniffing
Recap
2. SSRS Solutions
• Compress Images
• Explicitly Define Property Values
• Don’t Render HTML
• Caching and Snapshots
3. Hybrid Solutions
• CRUD Operations
• Dynamic SQL
• Subreport Switching
24
Thank you!
Twitter: @bertwagner
Blog: bertwagner.com <- new posts Tuesdays
Vlog: youtube.com/c/bertwagner<- new episodes Tuesdays
Email: bert@bertwagner.com
25

Más contenido relacionado

La actualidad más candente

Building Software to Scale
Building Software to Scale Building Software to Scale
Building Software to Scale SingleStore
 
What we learned at pass summit in 2018
What we learned at pass summit in 2018What we learned at pass summit in 2018
What we learned at pass summit in 2018Red Gate Software
 
O'Reilly Media Webcast: Building Real-Time Data Pipelines
O'Reilly Media Webcast: Building Real-Time Data PipelinesO'Reilly Media Webcast: Building Real-Time Data Pipelines
O'Reilly Media Webcast: Building Real-Time Data PipelinesSingleStore
 
SQL Server 2016 new features
SQL Server 2016 new featuresSQL Server 2016 new features
SQL Server 2016 new featuresSpanishPASSVC
 
In-Memory Stream Processing with Hazelcast Jet @JEEConf
In-Memory Stream Processing with Hazelcast Jet @JEEConfIn-Memory Stream Processing with Hazelcast Jet @JEEConf
In-Memory Stream Processing with Hazelcast Jet @JEEConfNazarii Cherkas
 
Joel Chamberlain Business Intelligence Portfolio
Joel Chamberlain Business Intelligence PortfolioJoel Chamberlain Business Intelligence Portfolio
Joel Chamberlain Business Intelligence Portfoliojwchamb
 
Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's Newdpcobb
 
SQL Server Replication Transactional Replication from MSSQL 200x to MYSQL 5.x
SQL Server Replication Transactional Replication  from MSSQL 200x to MYSQL 5.xSQL Server Replication Transactional Replication  from MSSQL 200x to MYSQL 5.x
SQL Server Replication Transactional Replication from MSSQL 200x to MYSQL 5.xThet Aung Min Latt
 
Improving Reporting Performance
Improving Reporting PerformanceImproving Reporting Performance
Improving Reporting PerformanceDhiren Gala
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACsqlserver.co.il
 
Configuration Driven Reporting On Large Dataset Using Apache Spark
Configuration Driven Reporting On Large Dataset Using Apache SparkConfiguration Driven Reporting On Large Dataset Using Apache Spark
Configuration Driven Reporting On Large Dataset Using Apache SparkDatabricks
 
Modeling the Smart and Connected City of the Future with Kafka and Spark
Modeling the Smart and Connected City of the Future with Kafka and SparkModeling the Smart and Connected City of the Future with Kafka and Spark
Modeling the Smart and Connected City of the Future with Kafka and SparkSingleStore
 
Architectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym ZhiltsovArchitectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym ZhiltsovLohika_Odessa_TechTalks
 
Add Historical Analysis of Operational Data with Easy Configurations in Fivet...
Add Historical Analysis of Operational Data with Easy Configurations in Fivet...Add Historical Analysis of Operational Data with Easy Configurations in Fivet...
Add Historical Analysis of Operational Data with Easy Configurations in Fivet...Databricks
 
Sql server 2008_replication_technical_case_study
Sql server 2008_replication_technical_case_studySql server 2008_replication_technical_case_study
Sql server 2008_replication_technical_case_studyKlaudiia Jacome
 

La actualidad más candente (17)

Building Software to Scale
Building Software to Scale Building Software to Scale
Building Software to Scale
 
What we learned at pass summit in 2018
What we learned at pass summit in 2018What we learned at pass summit in 2018
What we learned at pass summit in 2018
 
O'Reilly Media Webcast: Building Real-Time Data Pipelines
O'Reilly Media Webcast: Building Real-Time Data PipelinesO'Reilly Media Webcast: Building Real-Time Data Pipelines
O'Reilly Media Webcast: Building Real-Time Data Pipelines
 
SQL Server 2016 new features
SQL Server 2016 new featuresSQL Server 2016 new features
SQL Server 2016 new features
 
In-Memory Stream Processing with Hazelcast Jet @JEEConf
In-Memory Stream Processing with Hazelcast Jet @JEEConfIn-Memory Stream Processing with Hazelcast Jet @JEEConf
In-Memory Stream Processing with Hazelcast Jet @JEEConf
 
Joel Chamberlain Business Intelligence Portfolio
Joel Chamberlain Business Intelligence PortfolioJoel Chamberlain Business Intelligence Portfolio
Joel Chamberlain Business Intelligence Portfolio
 
Aws aurora scaling
Aws aurora scalingAws aurora scaling
Aws aurora scaling
 
Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
 
SQL Server Replication Transactional Replication from MSSQL 200x to MYSQL 5.x
SQL Server Replication Transactional Replication  from MSSQL 200x to MYSQL 5.xSQL Server Replication Transactional Replication  from MSSQL 200x to MYSQL 5.x
SQL Server Replication Transactional Replication from MSSQL 200x to MYSQL 5.x
 
Improving Reporting Performance
Improving Reporting PerformanceImproving Reporting Performance
Improving Reporting Performance
 
Sql Nexus
Sql NexusSql Nexus
Sql Nexus
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DAC
 
Configuration Driven Reporting On Large Dataset Using Apache Spark
Configuration Driven Reporting On Large Dataset Using Apache SparkConfiguration Driven Reporting On Large Dataset Using Apache Spark
Configuration Driven Reporting On Large Dataset Using Apache Spark
 
Modeling the Smart and Connected City of the Future with Kafka and Spark
Modeling the Smart and Connected City of the Future with Kafka and SparkModeling the Smart and Connected City of the Future with Kafka and Spark
Modeling the Smart and Connected City of the Future with Kafka and Spark
 
Architectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym ZhiltsovArchitectural peripherals of react by Vadym Zhiltsov
Architectural peripherals of react by Vadym Zhiltsov
 
Add Historical Analysis of Operational Data with Easy Configurations in Fivet...
Add Historical Analysis of Operational Data with Easy Configurations in Fivet...Add Historical Analysis of Operational Data with Easy Configurations in Fivet...
Add Historical Analysis of Operational Data with Easy Configurations in Fivet...
 
Sql server 2008_replication_technical_case_study
Sql server 2008_replication_technical_case_studySql server 2008_replication_technical_case_study
Sql server 2008_replication_technical_case_study
 

Similar a High Performance SSRS

High Performance SSRS
High Performance SSRSHigh Performance SSRS
High Performance SSRSBert Wagner
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersTobias Koprowski
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersTobias Koprowski
 
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginnersKoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginnersTobias Koprowski
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersShehap Elnagar
 
Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsMatt Kuklinski
 
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
 
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.
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsZohar Elkayam
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersShehap Elnagar
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersShehap Elnagar
 
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...Denny Lee
 
MOUG17: SQLT Utility for Tuning - Practical Examples
MOUG17: SQLT Utility for Tuning - Practical ExamplesMOUG17: SQLT Utility for Tuning - Practical Examples
MOUG17: SQLT Utility for Tuning - Practical ExamplesMonica Li
 
MOUG17: DB Security; Secure your Data
MOUG17: DB Security; Secure your DataMOUG17: DB Security; Secure your Data
MOUG17: DB Security; Secure your DataMonica Li
 
SharePoint Troubleshooting
SharePoint TroubleshootingSharePoint Troubleshooting
SharePoint TroubleshootingToby McGrail
 
Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the fieldJoAnna Cheshire
 
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarGeek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarIDERA Software
 
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
 
Sql Server tips from the field
Sql Server tips from the fieldSql Server tips from the field
Sql Server tips from the fieldInnoTech
 

Similar a High Performance SSRS (20)

High Performance SSRS
High Performance SSRSHigh Performance SSRS
High Performance SSRS
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginnersKoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
KoprowskiT_HUG-MSSQL_AdHocMaintenancePlansForBeginners
 
Breaking data
Breaking dataBreaking data
Breaking data
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
 
Boosting the Performance of your Rails Apps
Boosting the Performance of your Rails AppsBoosting the Performance of your Rails Apps
Boosting the Performance of your Rails Apps
 
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...
 
SQL Server Reporting Services (SSRS) 101
 SQL Server Reporting Services (SSRS) 101 SQL Server Reporting Services (SSRS) 101
SQL Server Reporting Services (SSRS) 101
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAsOracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
 
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
Building and Deploying Large Scale SSRS using Lessons Learned from Customer D...
 
MOUG17: SQLT Utility for Tuning - Practical Examples
MOUG17: SQLT Utility for Tuning - Practical ExamplesMOUG17: SQLT Utility for Tuning - Practical Examples
MOUG17: SQLT Utility for Tuning - Practical Examples
 
MOUG17: DB Security; Secure your Data
MOUG17: DB Security; Secure your DataMOUG17: DB Security; Secure your Data
MOUG17: DB Security; Secure your Data
 
SharePoint Troubleshooting
SharePoint TroubleshootingSharePoint Troubleshooting
SharePoint Troubleshooting
 
Sql server tips from the field
Sql server tips from the fieldSql server tips from the field
Sql server tips from the field
 
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent OzarGeek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
Geek Sync | Planning a SQL Server to Azure Migration in 2021 - Brent Ozar
 
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
 
Sql Server tips from the field
Sql Server tips from the fieldSql Server tips from the field
Sql Server tips from the field
 

Más de Bert Wagner

SQL Injection Attacks - Is Your Data Secure? SQL Saturday Rochester
SQL Injection Attacks - Is Your Data Secure?  SQL Saturday Rochester SQL Injection Attacks - Is Your Data Secure?  SQL Saturday Rochester
SQL Injection Attacks - Is Your Data Secure? SQL Saturday Rochester Bert Wagner
 
DBAs vs Developers - JSON in SQL Server
DBAs vs Developers - JSON in SQL ServerDBAs vs Developers - JSON in SQL Server
DBAs vs Developers - JSON in SQL ServerBert Wagner
 
SQL Injection Attacks - Is Your Data Secure? GroupBy Conference
SQL Injection Attacks - Is Your Data Secure? GroupBy ConferenceSQL Injection Attacks - Is Your Data Secure? GroupBy Conference
SQL Injection Attacks - Is Your Data Secure? GroupBy ConferenceBert Wagner
 
DBAs vs Developers: JSON in SQL Server - CBusPASS
DBAs vs Developers: JSON in SQL Server - CBusPASSDBAs vs Developers: JSON in SQL Server - CBusPASS
DBAs vs Developers: JSON in SQL Server - CBusPASSBert Wagner
 
SQL Injection Attacks: Is Your Data Secure? .NET Edition
SQL Injection Attacks: Is Your Data Secure? .NET EditionSQL Injection Attacks: Is Your Data Secure? .NET Edition
SQL Injection Attacks: Is Your Data Secure? .NET EditionBert Wagner
 
SQL Injection Attacks: Is Your Data Secure?
SQL Injection Attacks: Is Your Data Secure?SQL Injection Attacks: Is Your Data Secure?
SQL Injection Attacks: Is Your Data Secure?Bert Wagner
 
DBAs vs Developers: JSON in SQL Server
DBAs vs Developers: JSON in SQL ServerDBAs vs Developers: JSON in SQL Server
DBAs vs Developers: JSON in SQL ServerBert Wagner
 
JSON in SQL Server 2016
JSON in SQL Server 2016JSON in SQL Server 2016
JSON in SQL Server 2016Bert Wagner
 
Json usage and performance in sql server 2016
Json usage and performance in sql server 2016Json usage and performance in sql server 2016
Json usage and performance in sql server 2016Bert Wagner
 

Más de Bert Wagner (9)

SQL Injection Attacks - Is Your Data Secure? SQL Saturday Rochester
SQL Injection Attacks - Is Your Data Secure?  SQL Saturday Rochester SQL Injection Attacks - Is Your Data Secure?  SQL Saturday Rochester
SQL Injection Attacks - Is Your Data Secure? SQL Saturday Rochester
 
DBAs vs Developers - JSON in SQL Server
DBAs vs Developers - JSON in SQL ServerDBAs vs Developers - JSON in SQL Server
DBAs vs Developers - JSON in SQL Server
 
SQL Injection Attacks - Is Your Data Secure? GroupBy Conference
SQL Injection Attacks - Is Your Data Secure? GroupBy ConferenceSQL Injection Attacks - Is Your Data Secure? GroupBy Conference
SQL Injection Attacks - Is Your Data Secure? GroupBy Conference
 
DBAs vs Developers: JSON in SQL Server - CBusPASS
DBAs vs Developers: JSON in SQL Server - CBusPASSDBAs vs Developers: JSON in SQL Server - CBusPASS
DBAs vs Developers: JSON in SQL Server - CBusPASS
 
SQL Injection Attacks: Is Your Data Secure? .NET Edition
SQL Injection Attacks: Is Your Data Secure? .NET EditionSQL Injection Attacks: Is Your Data Secure? .NET Edition
SQL Injection Attacks: Is Your Data Secure? .NET Edition
 
SQL Injection Attacks: Is Your Data Secure?
SQL Injection Attacks: Is Your Data Secure?SQL Injection Attacks: Is Your Data Secure?
SQL Injection Attacks: Is Your Data Secure?
 
DBAs vs Developers: JSON in SQL Server
DBAs vs Developers: JSON in SQL ServerDBAs vs Developers: JSON in SQL Server
DBAs vs Developers: JSON in SQL Server
 
JSON in SQL Server 2016
JSON in SQL Server 2016JSON in SQL Server 2016
JSON in SQL Server 2016
 
Json usage and performance in sql server 2016
Json usage and performance in sql server 2016Json usage and performance in sql server 2016
Json usage and performance in sql server 2016
 

Último

Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
Things you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceThings you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceMartin Humpolec
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdfPedro Manuel
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024SkyPlanner
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.francesco barbera
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfAijun Zhang
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfDaniel Santiago Silva Capera
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1DianaGray10
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxGDSC PJATK
 
Introduction to Quantum Computing
Introduction to Quantum ComputingIntroduction to Quantum Computing
Introduction to Quantum ComputingGDSC PJATK
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
20200723_insight_release_plan
20200723_insight_release_plan20200723_insight_release_plan
20200723_insight_release_planJamie (Taka) Wang
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 

Último (20)

Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
Things you didn't know you can use in your Salesforce
Things you didn't know you can use in your SalesforceThings you didn't know you can use in your Salesforce
Things you didn't know you can use in your Salesforce
 
Nanopower In Semiconductor Industry.pdf
Nanopower  In Semiconductor Industry.pdfNanopower  In Semiconductor Industry.pdf
Nanopower In Semiconductor Industry.pdf
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024Salesforce Miami User Group Event - 1st Quarter 2024
Salesforce Miami User Group Event - 1st Quarter 2024
 
Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.Digital magic. A small project for controlling smart light bulbs.
Digital magic. A small project for controlling smart light bulbs.
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Machine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdfMachine Learning Model Validation (Aijun Zhang 2024).pdf
Machine Learning Model Validation (Aijun Zhang 2024).pdf
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdfIaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
IaC & GitOps in a Nutshell - a FridayInANuthshell Episode.pdf
 
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1UiPath Platform: The Backend Engine Powering Your Automation - Session 1
UiPath Platform: The Backend Engine Powering Your Automation - Session 1
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Cybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptxCybersecurity Workshop #1.pptx
Cybersecurity Workshop #1.pptx
 
Introduction to Quantum Computing
Introduction to Quantum ComputingIntroduction to Quantum Computing
Introduction to Quantum Computing
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
20200723_insight_release_plan
20200723_insight_release_plan20200723_insight_release_plan
20200723_insight_release_plan
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 

High Performance SSRS

  • 1. High Performance SSRS: Techniques for Fast Reporting | Bert Wagner | February 3, 2018 1
  • 2. Objective • Eliminate these (or at least reduce their time on screen) • i.e. make your reports fast 2
  • 3. Background • Business Intelligence Developer @ Progressive Insurance • SSRS, SSIS, SQL, .NET, API, IoT, LOL, ROFL, and LMAO… • I like making things go fast Demo code and slides available at bertwagner.com Will be using StackOverflow data dump 3
  • 4. There are 3 main things you can do: • SQL solutions • Reporting solutions • Hybrid special case solutions SSRS Performance Tuning 4
  • 5. Part 1: SQL Solutions 5
  • 6. Audience Participation: Which interval is longer? Photo by Abigail Lynn on Unsplash The audience during my last SSRS presentation 6
  • 7. SQL Solutions: SSRS Usage Data ● You need a baseline for performance testing! ● SSRS database has built in logging for analysis ○ https://msdn.microsoft.com/en-us/library/ms159110.aspx ○ Use the “ExecutionLog3” view ● 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…) 7
  • 8. Audience Participation: Which is the right tool? “Toy Pail and Shovel" by Kelly D Photography is licensed under CC BY-NC 2.0 “Construction Equipment” by Dimitriy is licensed under CC BY-NC 2.0 8
  • 9. Audience Participation: Which is the right tool? “Sand Castles" by Dave Gunn is licensed under CC BY-NC 2.0 “A Hole In The Ground" by Jitze Couperus is licensed under CC BY 2.0 9
  • 10. SQL Solutions: Tool 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… 10 Demo
  • 11. SQL Solutions: Tool 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 11 Demo
  • 12. SQL Solutions: Disk IO, Network IO a.k.a. Don’t use SELECT * Using SELECT *: ● Returns more data than is needed ● Affects read time off disk ● Fills buffer pool ● Affects time spent on the network ● Prevents smaller, data dense indexes from being used ● Could impact SARGABILITY – indexes might not be used to filter data, table scan instead ● Could break queries/reports ● Gives no hints to future developers about intentions Photo by Brooke Lark on Unsplash 12
  • 13. SQL Solutions: Parameter Sniffing “Sometimes my report runs fast, other times slow” • It’s a feature! • Allows SQL Server to cache and reuse plans • Doesn’t work well if your data is skewed • Problematic if different parameter values should produce drastically different execution plans Photo by Amanda Kerr on Unsplash 13 Solutions: • RECOMPILE • OPTIMIZE FOR • IF/THEN • Additional information: https://bertwagner.com/2017/08/08/why-parameter- sniffing-isnt-always-a-bad-thing-but-usually-is/ Demo
  • 14. Part 2: SSRS Solutions 14
  • 15. Audience Participation: Spot the difference? 15 Photo by Gabriel Sanchez on UnsplashPhoto by Gabriel Sanchez on Unsplash
  • 16. 16 Photo by Gabriel Sanchez on UnsplashPhoto by Gabriel Sanchez on Unsplash SSRS Solutions: Compress Images GIF 74 KB JPG 5.44 MB SSRS will not compress your images. Reduce network IO and compress them yourself!
  • 17. SSRS Solutions: Explicitly Define Property Values 17 ● 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 Photo by Dawid Małecki on Unsplash
  • 18. SSRS Solutions: Don’t Render HTML • Rendering HTML reports is relatively expensive • Other options, like Excel, perform significantly faster • E.g. add &rs:Format=EXCELOPENXML to end of URL • Available formats found in your config file • Use EXCELOPENXML instead of default EXCEL to force the newer (smaller) version of Excel (applies to older versions of SSRS) 18
  • 19. SSRS Solutions: Caching and Snapshots • SSRS can cache reports if data (parameters!) don’t change • Data warehouse refreshed overnight? Don’t requery all day long • First person queries live, the rest get the cached copy • Can also schedule Snapshots • The results of a query at a specific time • Can schedule for certain times allowing all users (including the first) to receive snapshotted data 19 More information: https://docs.microsoft.com/en- us/sql/reporting-services/report-server/preload-the- cache-report-manager
  • 20. Part 3: Hybrid Solutions 20
  • 21. Hybrid Solutions: CRUD Operations 21 ● 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 Photo by Mr Cup / Fabien Barral on Unsplash Demo
  • 22. Hybrid Solutions: Dynamic SQL 22 ● 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 ● Further info about SQL injection: https://bertwagner.com/2017/08/29/warning-are-your-queries- vulnerable-to-sql-injection/ Photo by Timothy Simon on Unsplash Demo
  • 23. Hybrid Solutions: Subreport Switching 23 ● 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 Photo by Natalia Y on Unsplash Demo
  • 24. 1. SQL Solutions • SSRS Usage Data • Tool Specialization • Disk IO, Network IO • Parameter Sniffing Recap 2. SSRS Solutions • Compress Images • Explicitly Define Property Values • Don’t Render HTML • Caching and Snapshots 3. Hybrid Solutions • CRUD Operations • Dynamic SQL • Subreport Switching 24
  • 25. Thank you! Twitter: @bertwagner Blog: bertwagner.com <- new posts Tuesdays Vlog: youtube.com/c/bertwagner<- new episodes Tuesdays Email: bert@bertwagner.com 25

Notas del editor

  1. Can also buy hardware! Can also bribe users not to run any reports at 8am when your CEO needs to access dashboards
  2. SSDs don’t solve these problems