|
| 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) |
0 commit comments