SlideShare une entreprise Scribd logo
1  sur  25
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

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à High Performance SSRS

High Performance SSRS
High Performance SSRSHigh Performance SSRS
High Performance SSRSBert Wagner
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersTobias Koprowski
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_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
 

Similaire à High Performance SSRS (20)

High Performance SSRS
High Performance SSRSHigh Performance SSRS
High Performance SSRS
 
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginnersKoprowskiT_SQLSat409_MaintenancePlansForBeginners
KoprowskiT_SQLSat409_MaintenancePlansForBeginners
 
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_MaintenancePlansForBeginnersKoprowskiT_SQLSaturday409_MaintenancePlansForBeginners
KoprowskiT_SQLSaturday409_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
 

Plus 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
 

Plus 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
 

Dernier

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

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

Notes de l'éditeur

  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