New SQL Server 2016 Live Query Statistics

SQL Server 2016 introduce a new feature Live query statistics which allows us to view the  real-time insights into query without needing to wait for the query to complete.

The live query plan displays the overall query progress and operator-level run-time execution statistics such as the number of rows produced, elapsed time, operator progress, etc.

Let’s see how it works.

I have opened the SSMS and write a sample query from Adventureworks databasse.

select a.* from HumanResources.Employee a cross apply HumanResources.Employee b

1.png

To view the live query execution plan, on the tools menu click the Live Query Statistics icon. Execute the query. The live query plan displays the execution plan as below

2.png

You can also highlight the query and right click and select “Include Live Query Statistics”

3.png

Another way of selecting the live query plan is to use activity monitor.

4.png

When you specify Include Live Query Statistics information it automatically enables statistics profile infrastructure for the current query session.

There are two other ways to enable the statistics infrastructure which can be used to view the live query statistics from other sessions (such as from Activity Monitor).

  • Execute SET STATISTICS XML ON; or SET STATISTICS PROFILE ON; in the target session.
  • Enable the query_post_execution_showplan extended event. This is a server wide setting that enable live query statistics on all sessions.

 

Note: This feature is available beginning with SQL Server 2016 Management Studio, however it can work with SQL Server 2014.

That’s all about Live Query Statistics

Cheers

Hope you like the post!

Ramasankar Molleti

MSDN:LinkedIn:Twitter

 

Published by Ramasankar

Hi. I’m Ramasankar Molleti. I’m a passionate IT professional with over 14 years of experience on providing solutions for customers who are looking on cloud computing, Database Migration, Development, and Big Data. I love learning new technologies and share my knowledge to community. I am currently working as Sr Cloud Architect with focus on Cloud Infrastructure, Big Data. I work with developers to architect, build, and manage cloud infrastructure, and services. I have deeep knowledge and experience on working with various database platforms such as MS SQL Server, PostgeSQL, Oracle, MongoDB, Redshift, Dyanamodb, Amazon Aurora. I worked as Database Engineer, Database Administrator, BI Developer and successfully transit myself into Cloud Architect with focus on Cloud infranstructure and Big Data. I live in USA and put my thoughts down on this blog. If you want to get in touch with me, contact me on my Linkedin here: https://www.linkedin.com/in/ramasankar-molleti-23b13218/ My Certifications: Amazon: AWS Certified Solutions Architect – Professional AWS Certified DevOps Engineer – Professional certificate AWS Certified Big Data – Specialty AWS Certified Security – Specialty certificate AWS Certified Advanced Networking – Specialty certificate AWS Certified Solutions Architect – Associate Microsoft: Microsoft® Certified Solutions Associate: SQL Server 2012/2014 Microsoft Certified Professional Microsoft® Certified IT Professional: Database Administrator 2008 Microsoft® Certified Technology Specialist: SQL Server 2008, Implementation and Maintenance

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: