|
| 1 | +--- |
| 2 | +title: "queryinsights.sql_pool_insights (Transact-SQL)" |
| 3 | +description: The queryinsights.sql_pool_insights in Microsoft Fabric provides actionable insights into the configuration and utilization of SQL pools. |
| 4 | +author: WilliamDAssafMSFT |
| 5 | +ms.author: wiassaf |
| 6 | +ms.reviewer: mariyaali |
| 7 | +ms.date: 11/12/2025 |
| 8 | +ms.service: sql |
| 9 | +ms.topic: reference |
| 10 | +f1_keywords: |
| 11 | + - "queryinsights.sql_pool_insights" |
| 12 | + - "queryinsights.sql_pool_insights_TSQL" |
| 13 | +helpviewer_keywords: |
| 14 | + - "queryinsights.sql_pool_insights system view" |
| 15 | + - "queryinsights.sql_pool_insights" |
| 16 | + - "query insights sql_pool_insights" |
| 17 | + - "SQL pools" |
| 18 | +dev_langs: |
| 19 | + - TSQL |
| 20 | +monikerRange: "=fabric" |
| 21 | +--- |
| 22 | +# queryinsights.sql_pool_insights (Transact-SQL) |
| 23 | + |
| 24 | +[!INCLUDE [Fabric SE DW](../../includes/applies-to-version/fabric-se-dw.md)] |
| 25 | + |
| 26 | + The `queryinsights.sql_pool_insights` in [!INCLUDE [fabric](../../includes/fabric.md)] Data Warehouse monitors resource allocation, tracks configuration changes, and identify periods when pools are under pressure. |
| 27 | + |
| 28 | +| Column name | Data type | Description | |
| 29 | +| --- | --- | --- | |
| 30 | +| `sql_pool_name` | **nvarchar(128)**| Name of the SQL pool. | |
| 31 | +| `timestamp` | **datetime2** | Timestamp when the health check or capacity change took place. | |
| 32 | +| `max_resource_percentage` | **int** | Maximum resource percentage allocated to the pool. | |
| 33 | +| `is_optimized_for_reads` | **bit** | Indicates if the pool is configured for read-optimized workloads. | |
| 34 | +| `current_workspace_capacity` | **nvarchar(16)**| Capacity currently used by the workspace. | |
| 35 | +| `is_pool_under_pressure` | **bit** | Indicates if the pool is under pressure. | |
| 36 | + |
| 37 | +## Remarks |
| 38 | + |
| 39 | +In Fabric Data Warehouse, resource isolation is enforced between `SELECT` and `NON SELECT` pools, preventing contention. Two pools are present by default: |
| 40 | + |
| 41 | + - `SELECT`: Handles read (`SELECT`) queries, optimized for analytics/reporting. |
| 42 | + - `NON SELECT` Handles data modification (`INSERT`, `UPDATE`, `DELETE`), optimized for ETL/ingestion. |
| 43 | + |
| 44 | +### Event-based reporting |
| 45 | + |
| 46 | +- New records are logged when pool configuration, workspace capacity, or pressure state changes. |
| 47 | +- Pressure state changes are logged if the pressure is sustained for **1 minute** or longer. |
| 48 | +- Events are only logged when the warehouse is active. If there is no activity on the warehouse, periodic events are paused and resume once activity is detected. This means that during periods of inactivity, there can be gaps in event logging until the warehouse becomes active again. |
| 49 | + |
| 50 | +## Permissions |
| 51 | + |
| 52 | +You should have access to a SQL analytics endpoint or warehouse within a Fabric Capacity workspace with Contributor or above permissions or Viewer with Monitor permissions. |
| 53 | + |
| 54 | +## Examples |
| 55 | + |
| 56 | +Use this view to correlate query performance issues with pool pressure and configuration changes. Visualize periods of pressure using window functions or external tools. Some examples follow: |
| 57 | + |
| 58 | +### A. Periods of pressure in the last 24 hours |
| 59 | + |
| 60 | +Show periods when the `SELECT` pool was under pressure in the last 24 hours: |
| 61 | + |
| 62 | +```sql |
| 63 | +-- Show periods when the SELECT pool was under pressure in the last 24 hours |
| 64 | +SELECT sql_pool_name, timestamp, is_pool_under_pressure |
| 65 | +FROM queryinsights.sql_pool_insights |
| 66 | +WHERE sql_pool_name = 'SELECT' |
| 67 | + AND timestamp >= DATEADD(hour, -24, GETDATE()) |
| 68 | + AND is_pool_under_pressure = 1 |
| 69 | +ORDER BY timestamp DESC; |
| 70 | +``` |
| 71 | + |
| 72 | +### B. Visualize pressure trends |
| 73 | + |
| 74 | +Calculate consecutive pressure periods and gaps using window functions: |
| 75 | + |
| 76 | +```sql |
| 77 | +-- Calculate consecutive pressure periods and gaps using window functions |
| 78 | +SELECT sql_pool_name, |
| 79 | + timestamp, |
| 80 | + is_pool_under_pressure, |
| 81 | + LAG(timestamp) OVER (PARTITION BY sql_pool_name ORDER BY timestamp) AS previous_event, |
| 82 | + DATEDIFF(minute, LAG(timestamp) OVER (PARTITION BY sql_pool_name ORDER BY timestamp), timestamp) AS minutes_since_last_event |
| 83 | +FROM queryinsights.sql_pool_insights |
| 84 | +WHERE sql_pool_name = 'SELECT' |
| 85 | +ORDER BY timestamp; |
| 86 | +``` |
| 87 | + |
| 88 | +## Next step |
| 89 | + |
| 90 | +> [!div class="nextstepaction"] |
| 91 | +> [Query insights in Microsoft Fabric](/fabric/data-warehouse/query-insights) |
| 92 | +
|
| 93 | +## Related content |
| 94 | + |
| 95 | +- [Query insights in Fabric data warehousing](/fabric/data-warehouse/query-insights) |
| 96 | +- [Monitor connections, sessions, and requests using DMVs](/fabric/data-warehouse/monitor-using-dmv) |
| 97 | +- [queryinsights.exec_requests_history (Transact-SQL)](queryinsights-exec-requests-history-transact-sql.md) |
| 98 | +- [queryinsights.exec_sessions_history (Transact-SQL)](queryinsights-exec-sessions-history-transact-sql.md) |
| 99 | +- [queryinsights.long_running_queries (Transact-SQL)](queryinsights-long-running-queries-transact-sql.md) |
| 100 | +- [queryinsights.frequently_run_queries (Transact-SQL)](queryinsights-frequently-run-queries-transact-sql.md) |
0 commit comments