From the course: Microsoft SQL Server 2016: Query Data

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Viewing index usage and statistics

Viewing index usage and statistics - SQL Server Tutorial

From the course: Microsoft SQL Server 2016: Query Data

Start my 1-month free trial

Viewing index usage and statistics

- [Instructor] In this lesson we'll provide an introduction to query statistics. Statistics are another tool in the SQL Server arsenal. To help you understand your query performance. Essentially, they offer details about the execution of your Transact-SQL Statements. You use the SET STATISTICS command accompanied by a statistics type that you want to check, and then the ON key word to enable those statistics and the OFF keyword to disable the statistics. Let's see an example of that in SQL Server management studio. The first one that we'll take a look at is setting TIME STATISTICS on. I'm going to un-comment this line, and we're going to highlight and execute this by itself. This will now enable TIME STATISTICS for any queries that we run within this session. So as we scroll down, we'll find a simple query here that is going to SELECT * from our Person table. Let's run it. And we see that our query has executed successfully here. We also note that we have returned 19,970 rows. So it…

Contents