Skip to content

Commit b6af155

Browse files
20231030 Fabric query insights
1 parent 15e52a8 commit b6af155

3 files changed

Lines changed: 156 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
title: "queryinsights.exec_requests_history (Transact-SQL)"
3+
description: "The queryinsights.exec_requests_history in Microsoft Fabric provides information about each complete SQL request."
4+
author: WilliamDAssafMSFT
5+
ms.author: wiassaf
6+
ms.reviewer: mariyaali
7+
ms.date: 10/30/2023
8+
ms.service: sql
9+
ms.topic: "reference"
10+
f1_keywords:
11+
- "queryinsights.exec_requests_history"
12+
- "queryinsights.exec_requests_history_TSQL"
13+
helpviewer_keywords:
14+
- "queryinsights.exec_requests_history system view"
15+
- "queryinsights.exec_requests_history"
16+
- "query insights frequently_run_queries"
17+
dev_langs:
18+
- "TSQL"
19+
monikerRange: "=fabric"
20+
---
21+
# queryinsights.exec_requests_history (Transact-SQL)
22+
[!INCLUDE [fabric-se-and-dw](../../includes/applies-to-version/fabric-se-and-dw.md)]
23+
24+
The `queryinsights.exec_requests_history` in [!INCLUDE [fabric](../../includes/fabric.md)] provides information about each complete SQL request.
25+
26+
| Column name | Data type | Description |
27+
| --- | --- | --- |
28+
|distributed_statement_id | uniqueid | Unique ID for each query.|
29+
|start_time | datetime2 | Time when the query started running.|
30+
|command | varchar(8000) | Complete text of the executed query.|
31+
|login_name | varchar(128) | Name of the user or system that sent the query.|
32+
|row_count | bigint | Number of rows retrieved by the query.|
33+
|total_elapsed_time_ms | int | Total time (ms) taken by the query to finish.|
34+
|status | varchar(30) | Query status (Succeeded, Failed, or Canceled).|
35+
|session_id | smallint | ID linking the query to a specific user session.|
36+
|connection_id | uniqueid (nullable) | Identification number for the query's connection.|
37+
|batch_id | uniqueid (nullable) | ID for grouped queries (if applicable).|
38+
|root_batch_id | uniqueid (nullable) | ID for the main group of queries (if nested).|
39+
40+
## Permissions
41+
42+
You should have access to a [[!INCLUDE [fabric-se](../../includes/fabric-se.md)]](/fabric/data-warehouse/data-warehousing#sql-endpoint-of-the-lakehouse) or [[!INCLUDE [fabric-dw](../../includes/fabric-dw.md)]](/fabric/data-warehouse/data-warehousing#synapse-data-warehouse) within a [Premium capacity](/power-bi/enterprise/service-premium-what-is) workspace with Contributor or above permissions.
43+
44+
## Related content
45+
46+
- [Monitoring connections, sessions, and requests using DMVs in Microsoft Fabric](/fabric/data-warehouse/monitor-using-dmv)
47+
- [queryinsights.long_running_queries (Transact-SQL)](queryinsights-long-running-queries-transact-sql.md)
48+
- [queryinsights.frequently_run_queries (Transact-SQL)](queryinsights-frequently-run-queries-transact-sql.md)
49+
50+
## Next step
51+
52+
> [!div class="nextstepaction"]
53+
> [Query insights in Microsoft Fabric](/fabric/data-warehouse/query-insights)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: "queryinsights.frequently_run_queries (Transact-SQL)"
3+
description: "The queryinsights.frequently_run_queries provides information about frequently run queries in Fabric Data Warehousing."
4+
author: WilliamDAssafMSFT
5+
ms.author: wiassaf
6+
ms.reviewer: mariyaali
7+
ms.date: 10/30/2023
8+
ms.service: sql
9+
ms.topic: "reference"
10+
f1_keywords:
11+
- "queryinsights.frequently_run_queries"
12+
- "queryinsights.frequently_run_queries_TSQL"
13+
helpviewer_keywords:
14+
- "queryinsights.frequently_run_queries system view"
15+
- "queryinsights.frequently_run_queries"
16+
- "query insights frequently_run_queries"
17+
dev_langs:
18+
- "TSQL"
19+
monikerRange: "=fabric"
20+
---
21+
# queryinsights.frequently_run_queries (Transact-SQL)
22+
[!INCLUDE [fabric-se-and-dw](../../includes/applies-to-version/fabric-se-and-dw.md)]
23+
24+
The `queryinsights.frequently_run_queries` in [!INCLUDE [fabric](../../includes/fabric.md)] provides information about frequently run queries in Fabric Data Warehousing.
25+
26+
| Column name | Data type | Description |
27+
| --- | --- | --- |
28+
| last_run_start_time | datetime2 | Time of the most recent query execution.|
29+
|last_run_command | varchar(8000) | Text of the last query execution.|
30+
| number_of_runs | int | Total number of times the query was executed.|
31+
| avg_total_elapsed_time_ms | int | Average query execution time (ms) across all runs.|
32+
| last_run_total_elapsed_time_ms | int | Time taken by the last execution (ms).|
33+
| last_dist_statement_id | uniqueidentifier | ID linking the query to `queryinsights.exec_requests_history`.|
34+
|last_run_session_id | smallint | User session ID for the last execution.|
35+
| min_run_total_elapsed_time_ms | int |Shortest query execution time (ms).|
36+
|max_run_total_elapsed_time_ms | int |Longest query execution time (ms).|
37+
|number_of_successful_runs | int |Number of successful query executions.|
38+
|number_of_failed_runs |int |Number of failed query executions.|
39+
|number_of_cancelled_runs |int |Number of canceled query executions.|
40+
41+
## Permissions
42+
43+
You should have access to a [[!INCLUDE [fabric-se](../../includes/fabric-se.md)]](/fabric/data-warehouse/data-warehousing#sql-endpoint-of-the-lakehouse) or [[!INCLUDE [fabric-dw](../../includes/fabric-dw.md)]](/fabric/data-warehouse/data-warehousing#synapse-data-warehouse) within a [Premium capacity](/power-bi/enterprise/service-premium-what-is) workspace with Contributor or above permissions.
44+
45+
## Related content
46+
47+
- [Monitoring connections, sessions, and requests using DMVs in Microsoft Fabric](/fabric/data-warehouse/monitor-using-dmv)
48+
- [queryinsights.long_running_queries (Transact-SQL)](queryinsights-long-running-queries-transact-sql.md)
49+
- [queryinsights.exec_requests_history (Transact-SQL)](queryinsights-exec-requests-history-transact-sql.md)
50+
51+
## Next step
52+
53+
> [!div class="nextstepaction"]
54+
> [Query insights in Microsoft Fabric](/fabric/data-warehouse/query-insights)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: "queryinsights.long_running_queries (Transact-SQL)"
3+
description: "The queryinsights.long_running_queries in Microsoft Fabric provides information about SQL query execution times."
4+
author: WilliamDAssafMSFT
5+
ms.author: wiassaf
6+
ms.reviewer: mariyaali
7+
ms.date: 10/30/2023
8+
ms.service: sql
9+
ms.topic: "reference"
10+
f1_keywords:
11+
- "queryinsights.long_running_queries"
12+
- "queryinsights.long_running_queries_TSQL"
13+
helpviewer_keywords:
14+
- "queryinsights.long_running_queries system view"
15+
- "queryinsights.long_running_queries"
16+
- "query insights long_running_queries"
17+
dev_langs:
18+
- "TSQL"
19+
monikerRange: "=fabric"
20+
---
21+
# queryinsights.long_running_queries (Transact-SQL)
22+
[!INCLUDE [fabric-se-and-dw](../../includes/applies-to-version/fabric-se-and-dw.md)]
23+
24+
The `queryinsights.long_running_queries` in [!INCLUDE [fabric](../../includes/fabric.md)] provides information about SQL query execution times.
25+
26+
| Column name | Data type | Description |
27+
| --- | --- | --- |
28+
|last_run_start_time | datetime2 | Time of the most recent query execution.|
29+
|last_run_command | varchar(8000) | Text of the last query execution.|
30+
|median_total_elapsed_time_ms | int | Median query execution time (ms) across runs.|
31+
|number_of_runs | int | Total number of times the query was executed.|
32+
|last_run_total_elapsed_time_ms | int | Time taken by the last execution (ms).|
33+
|last_dist_statement_id | uniqueidentifier | ID linking the query to `queryinsights.exec_requests_history`.|
34+
|last_run_session_id | smallint | User session ID for the last execution.|
35+
36+
## Permissions
37+
38+
You should have access to a [[!INCLUDE [fabric-se](../../includes/fabric-se.md)]](/fabric/data-warehouse/data-warehousing#sql-endpoint-of-the-lakehouse) or [[!INCLUDE [fabric-dw](../../includes/fabric-dw.md)]](/fabric/data-warehouse/data-warehousing#synapse-data-warehouse) within a [Premium capacity](/power-bi/enterprise/service-premium-what-is) workspace with Contributor or above permissions.
39+
40+
## Related content
41+
42+
- [Monitoring connections, sessions, and requests using DMVs in Microsoft Fabric](/fabric/data-warehouse/monitor-using-dmv)
43+
- [queryinsights.exec_requests_history (Transact-SQL)](queryinsights-exec-requests-history-transact-sql.md)
44+
- [queryinsights.frequently_run_queries (Transact-SQL)](queryinsights-frequently-run-queries-transact-sql.md)
45+
46+
## Next step
47+
48+
> [!div class="nextstepaction"]
49+
> [Query insights in Microsoft Fabric](/fabric/data-warehouse/query-insights)

0 commit comments

Comments
 (0)