I often travel across the world presenting on SQL Server Performance Tuning Topics. When I am not busy with Comprehensive Database Performance Health Check, I like to train IT professionals with SQL Server Performance Tuning Practical Workshop. I personally believe that I can’t reach everywhere to help with SQL Server Performance issues but if I train more people on this topic, they can virtually replicate me to solve their SQL Server issues. Today we will talk about a sample long-running query which I use for my demonstrations.

Long-Running Query for Demonstrations
Quite often during the training, I demonstrate techniques to identify the long-running queries and how to troubleshoot them. Here is the query which I have built based on the WideWorldImporters database and it keeps on running on the extremely fast machine for over an hour.
USE WideWorldImporters
GO
-- Long Query
SELECT *
FROM [Sales].[InvoiceLines] il
INNER JOIN [Sales].[Invoices] i ON i.InvoiceID = il.InvoiceID
INNER JOIN [Sales].[OrderLines] ol ON ol.OrderID = i.OrderID
INNER JOIN [Sales].[Orders] o ON o.OrderID = ol.OrderID
GOThere are scenarios when I have to run the query much faster and in that case, I keep any one of them joins in the above script and remove the rest of the join.
I will be traveling to various different countries in Europe in September 2019. Here are the details of the my travel: September 2019 Training Updates – Czech Republic, Netherlands, Sweden, Denmark.
If you are interested in learning my SQL server Performance Tuning secrets, I strongly suggest that you enrole yourself in Recorded Online Classes SQL Server Performance Tuning Practical Workshop – Recorded Classes.
Let me know if you want to read about any particular topic of SQL Server Performance Tuning and I will be happy to blog about them in the future.
Here are a few additional blog posts on this topic:
- In-Memory OLTP Migration Checklist: Which Features Block You
- SQL SERVER – T-SQL Script to Identify TOP 10 Parallel Running Queries
- SQL SERVER – Using Query Hint ENABLE_PARALLEL_PLAN_PREFERENCE
- SQL SERVER – Identify Read Heavy Workload or Write Heavy Workload Type by Counters
Published by Pinal Dave on SQLAuthority. More of my work at pinaldave.com.
Discover more from SQL Authority with Pinal Dave
Subscribe to get the latest posts sent to your email.





1 Comment. Leave new
Hi,
Have you thought about coming to Romania? Cluj-Napoca is Silicon Valley from Romania.