Edit

queryinsights.sql_pool_insights (Transact-SQL)

Applies to: SQL analytics endpoint in Microsoft Fabric and Warehouse in Microsoft Fabric

The queryinsights.sql_pool_insights in Microsoft Fabric Data Warehouse monitors resource allocation, tracks configuration changes, and identifies periods when pools are under pressure.

Column name Data type Description
sql_pool_name nvarchar(128) Name of the SQL pool.
timestamp datetime2 Timestamp when the health check or capacity change took place.
max_resource_percentage int Maximum resource percentage allocated to the pool.
is_optimized_for_reads bit Indicates if the pool is configured for read-optimized workloads.
current_workspace_capacity nvarchar(16) Capacity currently used by the workspace.
is_pool_under_pressure bit Indicates if the pool is under pressure.

Remarks

In Fabric Data Warehouse, resource isolation is enforced between SELECT and NON SELECT pools, preventing contention. Two pools are present by default:

  • SELECT: Handles read (SELECT) queries, optimized for analytics and reporting.
  • NON SELECT: Handles data modification (INSERT, UPDATE, DELETE), optimized for ETL and ingestion.

Event-based reporting

  • The database logs new records when pool configuration, workspace capacity, or pressure state changes.
  • The database logs pressure state changes if the pressure is sustained for 1 minute or longer.
  • The SQL Database Engine logs events only when the warehouse is active. If there's no activity on the warehouse, events pause and resume once activity is detected. This condition means that during periods of inactivity, event logging can have gaps until the warehouse becomes active again.

Permissions

You need access to a SQL analytics endpoint or warehouse within a Fabric Capacity workspace with Contributor or higher permissions, or Viewer with Monitor permissions.

Examples

Use this view to correlate query performance problems with pool pressure and configuration changes. Visualize periods of pressure by using window functions or external tools. Some examples follow:

A. Periods of pressure in the last 24 hours

Show periods when the SELECT pool was under pressure in the last 24 hours:

-- Show periods when the SELECT pool was under pressure in the last 24 hours
SELECT sql_pool_name, timestamp, is_pool_under_pressure
FROM queryinsights.sql_pool_insights
WHERE sql_pool_name = 'SELECT'
  AND timestamp >= DATEADD(hour, -24, GETDATE())
  AND is_pool_under_pressure = 1
ORDER BY timestamp DESC;

Calculate consecutive pressure periods and gaps by using window functions:

-- Calculate consecutive pressure periods and gaps using window functions
SELECT sql_pool_name,
       timestamp,
       is_pool_under_pressure,
       LAG(timestamp) OVER (PARTITION BY sql_pool_name ORDER BY timestamp) AS previous_event,
       DATEDIFF(minute, LAG(timestamp) OVER (PARTITION BY sql_pool_name ORDER BY timestamp), timestamp) AS minutes_since_last_event
FROM queryinsights.sql_pool_insights
WHERE sql_pool_name = 'SELECT'
ORDER BY timestamp;

Next step