The SQL activity refer to the actions and interactions involving Structured Query Language (SQL) within a database's system or application. SQL activity encompasses various operations and queries performed on a database and are important for monitoring, optimizing and troubleshooting database related issues. In SQL activity, you can see the following information about the queries which are listed below:

- DB Query Stats
- Blocking Sessions
- Locks
- I/O by File
- Deadlocks

## DB Query Stats

The DB query stats refers to the collected data and metrics related to the performance and behavior of database queries within a database management system, which are crucial for optimizing query performance, troubleshooting issues and maintaining the overall health and security of the database system. In the DB query stats window, you can see the following details which are listed below:

- Action In action, you can perform the following actions in the DB Query Stats which are listed below:
  1. Click to View SQL Query/Procedure : On clicking this icon, you will be able to access the SQL code which is associated with that particular database operation.
  2. Click to View Sub Query Plan: On clicking this icon, you will be able to access and examine the execution plan associated with a specific sub-query within a larger SQL query.
  3. Click to View Actual Plan: On clicking this icon, you will be able to access the real execution plan of an SQL query providing valuable insights into query performance, resource utilization and potential areas for optimizations.
  4. Click to View Execution Plan : On clicking this icon, you will be able to access and analyze the execution plan of a specific SQL query.
- Timestamp: This refers to a data element that records the date and time when a specific event or SQL query occurred within a database management system (DBMS). You can see the date and time in the following format MM/DD/YY and HH:MM:SS.
- Plan Handle: This refers to a unique identifier associated with the execution plan of an SQL query within a DBMS. It is used for plan caching, query performance analysis, query tuning and troubleshooting.
- CRL Time: This refers to the time taken for commit, rollback and log operations within a database transaction. It refers to the amount of time taken by a transaction for committing, rolling back, or logging changes made during the execution of an SQL query.
- Elapsed Time: This refers to the total amount of time that has passed from the initiation to the completion of a specific SQL query.
- Logical Reads: This refers to the number of logical reads performed for each request.
- Weight (%): This refers to the weightage of query execution based on elapsed time and represents the relative importance of an SQL query. It is a valuable metric for managing resources, assessing query performance, and making data-driven decisions to optimize database workloads.
- Logical Writes: This refers to the number of times data pages are modified or written to during the execution of an SQL query. This represents the changes made to the database's data pages, including: insert, update, or delete during query execution.
- Physical Reads: This refers to the number of physical disk I/O operations performed during the execution of an SQL query. This is essential for optimizing query performance, reducing disk I/O bottlenecks and improving the overall efficiency of a database management system (DBMS).
- Wait Time: This refers to the total amount of time that an SQL query spends waiting for various events to become available during its execution within a database management system (DBMS).
- Worker Time: This refers to the total amount of CPU time consumed by an SQL query during its execution within a database management system (DBMS).
- Creation Time: This refers to the timestamp that indicates when a specific SQL query was created or initiated within a database management system (DBMS).
- End Offset: This refers to the index within an SQL query where the query execution is completed.
- Last Wait Time: This refers to the amount of time that the most recent execution of an SQL query within a database management system (DBMS) spent waiting for a specific resource to become available.
- Max Wait Time: This refers to the maximum amount of time that any single wait event took to complete during the execution of an SQL query within a database management system (DBMS).
- Min Wait Time: This refers to the minimum amount of time that any single wait event took to complete during the execution of an SQL query within a database management system (DBMS).
- Server Name: This refers to the identifier of the specified database server where an SQL query is executed within a database management system (DBMS).
- SQL Handle: This refers to a unique identifier which is associated with an SQL query. SQL handle plays a crucial role in query management, performance analysis, query optimization, error hanling and resource allocation within a database management system (DBMS).
- Query/Procedure: This refers to the SQL query, stored procedure or dynamically generated SQL statement that is currently being executed within a database management system (DBMS).
- Start Offset: This refers to the index within an SQL query where the DBMS initiated the execution of the query. Start offset represents the character or byte position where the database management system (DBMS) initiated the processing if the query.
- Last Execution Time: This refers to the timestamp that records the date and time when the associated SQL query was most recently executed within a database management system (DBMS).
- Total CLR Time: This refers to the cumulative time spent executing Common Language Runtime (CLR) code within the context of an SQL query. It is an essential metric to understand the impact of custom.
- Total Elapsed Time: This refers to a cumulative amount of time that has elapsed from that initiation to the completion of the execution of an SQL query. It is a fundamental metric accessing query performance, diagnosing issues, optimizing resource usage, and ensuring the efficiency of database operations within a database management system (DBMS).
- Count: This refers to the number of times a specific SQL query has been executed within a database management system (DBMS).
- Total Logical Reads: This refers to the cumulative number of logical reads performed during the execution of a specific SQL query. It is a critical metric for assessing query performance, resource utilization and the efficiency of data access within a database management system (DBMS).
- Total Logical Writes: This refers to the cumulative number of logical write operations performed during the execution of a specific SQL query. It is a critical metric for assessing query performance, resource utilization, data modification and the durability of data changes within a database management system (DBMS). .
- Total Physical Reads: This refers to the cumulative number of physical read operations performed during the execution of a specific SQL query. It is a critical metric for assessing query performance, resource utilization, data retrieval efficiency, and overall system efficiency within a database management system (DBMS). .
- Total Wait Time: This refers to the cumulative amount of time that a query procedure has spent waiting for specific resources or conditions during its execution. It is a critical metric for assessing query performance, resource contention, and identifying areas for optimization within a database management system (DBMS).

### Table Operations

There are following operation which you can perform on the DB Query Stats table which are listed below:

- Search: You can perform search operation in the table by providing the query values in the Search in table column icon. You can search by providing timestamp, elapsed time, wait time, worker time etc in the search table column.
- Top: This will show the top N number of the list of DB query stats.
- Slow queries based on: This will display which query is taking more time to execute in DB. You can select the following options from the drop-down: Elapsed Time, I/O and CPU.
- Download : This will download the DB query stats report in the CSV file format in your local.
- Toggle Columns : On clicking this icon, you will be able to show or hide a column from the DB query stats window.
- Toggle Filter : On clicking this icon, you can apply search operation on columns in the DB query stats window.
- You can also see the applied time filter on the right side of the window.
- If you want to disable the analysis mode, then you have to click on the Analysis Mode Toggle button
- If you want to disable the real time mode, then you have to click on the Real Time Mode Toggle button.