queryinsights.long_running_queries (Transact-SQL)

Applies to: SQL analytics endpoint and Warehouse in Microsoft Fabric

The queryinsights.long_running_queries in Microsoft Fabric provides information about SQL query execution times.

Column name Data type Description
last_run_start_time datetime2 Time of the most recent query execution.
last_run_command varchar(8000) Text of the last query execution.
median_total_elapsed_time_ms int Median query execution time (ms) across runs.
number_of_runs int Total number of times the query was executed.
last_run_total_elapsed_time_ms int Time taken by the last execution (ms).
last_dist_statement_id uniqueidentifier ID linking the query to queryinsights.exec_requests_history.
last_run_session_id smallint User session ID for the last execution.

Permissions

You should have access to a SQL analytics endpoint or Warehouse within a Premium capacity workspace with Contributor or above permissions.

Next step