Query history

The query history shows SQL queries performed using SQL endpoints.

You can use the information available through this screen to help you debug issues with queries.

This section describes how to work with query history using the UI. To work with query history using the API, see Query History API.

View query history

To view the history of all executions of a query:

  1. Click History Icon Query History in the sidebar.
  2. Click the name of a query to see more details, such as the SQL command and the execution details.

You can filter the list by user, service principal, date range, SQL endpoint, and query status.

View query details

To view details about a query, such as its duration, SQL command, number of rows returned, and I/O performance:

  1. View query history.

  2. Click the name of a query.

    Query history details

  3. To view a query’s execution plan, see Query profile.

    Brief information about a query’s performance appears, such as time spent in each task, rows returned, and I/O performance.

  4. For more detailed information about the query’s performance, click Query Profile at the bottom of the page. For more details, see Query profile.

Terminate an executing query

To terminate a long-running query started by you or another user:

  1. View query history.

    1. Click the name of a query.

    Query history details

  2. Next to Status, click Cancel.

The query is terminated and its status changes to Canceled.