This article describes several ways to reduce SQL Server logical reads in I/O Statistics for fine-tuning SQL query performance.
“But it ran fine on our development server!”
How many times did I hear it when SQL query performance issues occurred here and there? I said it myself back in the day. I presumed that a query running in less than a second would run fine in production servers. But I was wrong.
Can you relate to this experience? If you are still in this boat today for whatever reason, this post is for you. It will give you a better metric of fine-tuning your SQL query performance. We’ll talk about three of the most critical figures in STATISTICS IO.
As an example, we will use the AdventureWorks sample database.
Before you start running queries below, turn on STATISTICS IO. Here’s how to do it in a query window:
USE AdventureWorks GO SET STATISTICS IO ON
Once you run a query with STATISTICS IO ON, different messages will appear. You can see these in the Messages tab of the query window in SQL Server Management Studio (see Figure 1):
Figure 1: Sample STATISTICS IO output in the Message tab of SSMS
Now that we’re done with the short intro let’s dig deeper.
SQL stands for Structured Query Language. SQL is a scripting language expected to store, control, and inquiry information put away in social databases. The main manifestation of SQL showed up in 1974, when a gathering in IBM built up the principal model of a social database. The primary business social database was discharged by Relational Software later turning out to be Oracle.
This is part 3 of “MS SQL Server- Zero to Hero” and in this article, we will be discussing about the SCHEMAS in SQL SERVER. Before getting into this article, please consider to visit previous articles in this series from below.
Debug SQL stored procedures and develop your SQL database project with dbForge SQL Complete, a new add-in for Visual Studio and SSMS. When you develop large chunks of T-SQL code with the help of the SQL Server Management Studio tool, it is essential to test the “Live” behavior of your code by making sure that each small piece of code works fine and being able to allocate any error message that may cause a failure within that code.
We may write a long query in our query window and we may need to refer the objects or other part of the T-SQL frequently. For that we may be scrolling up and down in the query window. But we have an awesome option for that in the SQL Query Window, Learn Split Query Window in SQL Server Management Studio(SSMS).
Creating T-SQL Query Shortcuts in SQL Server Management Studio(SSMS). Using keyboard shortcuts, it saves time, isn’t it? SQL Server Management Studio is also not an exception !!!. We can add our own custom keyboard shortcuts, that too for T-SQL query.