Monday, September 7, 2015

Cool New feature "Include Live Query Statistics"

Exploring SQL Server Management Studio Version 2016 CTP 2.

It has very cool feature "Include Live Query Statistics"

It has an new icon in the Toolbar right near "Actual Execution Plan" icon:




What is cool with that feature?
That is a live view of current query execution.

I've tried to come up with a query, which would demonstrate that:

USE AdventureWorks2014;
GO
DBCC DROPCLEANBUFFERS;
GO
;WITH Prices AS (
    SELECT dbo.ufnGetProductDealerPrice(d.ProductID, h.OrderDate) AS Price,
        ROW_NUMBER() over(ORDER BY p.MiddleNAme) rn, p.PersonType, pr.Color
    FROM Sales.SalesOrderDetail AS d
    INNER JOIN Sales.SalesOrderHeader AS h ON h.SalesOrderID = d.SalesOrderID
    INNER JOIN Person.Person AS p ON h.CustomerID = p.BusinessEntityID
    INNER JOIN Production.Product AS pr ON d.ProductID = pr.ProductID
) SELECT * FROM Prices;

And I was be able to capture a moment on the screen when Hash Match operation is already done and Sort operation just started.

In this case it might be not so useful, but for complex queries which run for several minutes minutes it would be very useful to see what SQL Server is doing right now and what a bottleneck there can be.

It looks like Microsoft finally decided to put more improvements into SSMS.
SSMS Rocks!

No comments:

Post a Comment