How to use MSSQL Activity Monitor to find the most expensive query?

A slow and long running SQL query execution consumes much processor, memory, and disk of your server so It is crucial to find and optimize them for performance tuning.such queries eventually delay the quick processing queries and hold them on the queue.

There are certain ways to identify and troubleshoot long running queries. This prevents potential performance issues.

SQL Activity Monitor is the easiest and rich UI tool available in SQL Server Management Studio.It provides information about processor time, waiting tasks, database I/O, and batch requests, and recent expensive queries.

 


The following steps describes how to identify the recent expensive queries.

  1. Login into your Windows VPS via RDP.

  2. Open MSSQL Management Studio and login as “sa” user. Click on the activity monitor icon shown in below image.

    MSSQL Activity Monitor

  3. The information about the CPU,RAM,disk and execution time of each query can be analyzed on SQL activity monitor.The queries with highest resource usage and maximum time execution queries are displayed in “Recent Expensive Queries”.

    SQL Recent Most Expensive Query


  4. Mouse hover to the query column to read the complete query.You need to optimize the query as much as possible to reduce the execution time and resource usage.You can directly edit the query in a text editor.Right-click the query and click on “Edit Query Text.”

    Edit Query On Activity Monitor

  5. The CPU(ms/sec) column shows how much processor time is used by query since the last compilation.It’s the ratio of processor time used by the query per second.
  • 0 Users Found This Useful

Was this answer helpful?

Related Articles

Choosing Between SQL Server 2012 and SQL Server 2014

If you are running SQL Server 2008 R2, you might be looking to upgrade your SQL server to...

How to create a Database (Asp .net or Other) on MSSQL Server?

If you have a Windows VPS / Dedicated server with MSSQL Server and WebsitePanel installed, you...

How do I connect to MSSQL Server 2012 from SQL Server Management Studio?

This article will guide you on how to connect to MS SQL Server 2012 from SQL Server Management...

How to Restore SQL Server 2012 Database Backup to SQL Server 2008?

Ideally, there is no way you can restore MS SQL Server 2012 database to SQL Server 2008 even if...

How to install MS SQL Server 2016?

Microsoft® SQL Server® 2016 is the latest version of Microsoft's relational database management...