Statistics IO

Jonathan Brotto 1,076 Reputation points
2021-12-23T18:59:31.897+00:00

I am new data admin and learning what my SQL 2019 box could do. My last job I was working with SQL 2005 box and reading on what I could do to improve performance. I saw Statistics IO and like some insight into that.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,761 questions
{count} votes

Accepted answer
  1. Seeya Xi-MSFT 16,441 Reputation points
    2021-12-24T06:16:00.607+00:00

    Hi @Jonathan Brotto

    Welcome to Microsoft Q&A!
    In addition to the official documentation mentioned by Erland, I hope you will take a look at the following articles, which contain some explanations combined with examples and video that will help you better understand SET STATISTICS IO ON.
    SQL Server: Performance Tuning :Understanding Set Statistics IO output
    How to use Statistics IO to Improve Your Query Performance--which one contains video
    Simple Query tuning with STATISTICS IO and Execution plans

    Best regards,
    Seeya


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Erland Sommarskog 101.4K Reputation points MVP
    2021-12-23T23:07:19.493+00:00

    If you have a query which you want to investigate in terms of performance, you can do:

       SET STATISTICS IO ON  
       go  
       \-- Run query here  
       go  
       SET STATISTICS IO OFF  
    

    This can give some information how the query is running. Basically, the higher number, the worse performance. Although this is not the only metric to look at. Duration and CPU is also important.

    Also see the documentation for SET STATISTICS IO ON.

    0 comments No comments