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

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

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

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

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
As a Principal Cloud Architect with over 18 years of experience, I am dedicated to revolutionizing IT landscapes through cutting-edge cloud solutions. My expertise spans Cloud Architecture, Security Architecture, Solution Design, Cloud Migration, Database Transformation, Development, and Big Data Analytics.Currently, I spearhead cloud initiatives with a focus on Infrastructure, Containerization, Security, Big Data, Machine Learning, and Artificial Intelligence. I collaborate closely with development teams to architect, build, and manage robust cloud ecosystems that drive business growth and technological advancement.Core Competencies:
• Cloud Platforms: AWS, Google Cloud Platform, Microsoft Azure
• Technologies: Kubernetes, Serverless Computing, Microservices
• Databases: MS SQL Server, PostgreSQL, Oracle, MongoDB, Amazon Redshift, DynamoDB, Aurora
• Industries: Finance, Retail, Manufacturing.
Throughout my career, I’ve had the privilege of working with industry leaders such as OCC, Gate Gourmet, Walgreens, and Johnson Controls, gaining invaluable insights across diverse sectors.As a lifelong learner and knowledge sharer, I take pride in being the first in my organization to complete all major AWS certifications. I am passionate about mentoring and guiding fellow professionals in their cloud journey, fostering a culture of continuous learning and innovation.Let’s connect and explore how we can leverage cloud technologies to transform your business:
• LinkedIn: https://www.linkedin.com/in/ramasankar-molleti-23b13218/
• Book a mentorship session: [1:1] Together, let’s architect the future of cloud computing and drive technological excellence.
Disclaimer
The views expressed on this website/blog are mine alone and do not reflect the views of my company. All postings on this blog are provided “AS IS” with no warranties, and confers no rights. The owner of https://ramasankarmolleti.com will not be liable for any errors or omissions in this information nor for the availability of this information. The owner will not be liable for any losses, injuries, or damages from the display or use of this information.
View more posts