Query Management is the history of every SQL query run on your data. Use it to find which queries ran, which failed and which cost the most, then copy the ones you want to work on into the Editor.
Live ClickHouse sits at the top right of the tab and opens the Queries view of ClickHouse activity; it appears when you hold View Active Queries. From there, the Query history button brings you back to this tab, and it needs View Query Management.
Click a row to open its details on the right; the open row stays highlighted. Click the same row again to close the panel.
A row opens only when it carries something to show: an error or an exception, or values in fields that are shown only in the details. Rows without any of those do not open.
The toggle at the top of the tab switches between four views. Each view lists its own columns and has its own default sort.
| View | What it lists | Sorted by default |
|---|---|---|
| Query Management | Every run in the query log, with its query, user, duration, memory and result. | Query Start Time, newest first |
| Repeated | Queries that ran more than once, with Occurrence Count, Users, Tables, Avg Duration, Max Duration, Avg Memory, First Seen and Last Seen. | Occurrence Count, highest first |
| Failed | Queries with at least one error, with Error Count, Users, Tables, Avg Duration, Last Error, First Seen and Last Seen. | Error Count, highest first |
| High Maintenance | Every query with its total cost, including Total Duration, Total Memory and Total Read, with their averages. | Total Duration, highest first |
Repeated, Failed and High Maintenance select queries by Last Seen, the last time each one ran. Their counts and totals cover every run the log holds, not only the runs in the period you chose. Last Error shows the latest error message, without its stack trace.
A view with nothing to show reads No repeated queries found, No failed queries found or No high maintenance queries found. The export on these three views needs only View Query Management, and the file is named repeated_queries, failed_queries or high_maintenance_queries.
| Setting | What it does | Default |
|---|---|---|
| Period | Sets the time range: Today, Last 7d, Last 30d or Custom. | Last 7d |
| Rows per page | Shows 50, 100 or 500 rows on each page. | 50 |
To see only the queries people ran, filter Log Name to User Query Log. The log also holds System Query Log rows for the platform's own queries, and System Query DDL Log rows for table changes.
Permissions are granted through roles. See Roles and permissions and Permission reference.
The log holds every query run on the ClickHouse database, including the platform's own queries and table changes. To see only the queries users ran, filter Log Name to User Query Log.
Open the Failed view to see queries with at least one error. The Last Error column shows the latest message. In Query Management, click the failed run and read its Exception section in the details panel.
Not from the log itself. Click the row, copy the SQL from the Query section, and paste it into a console in the Editor. To open a query that is running now, use Open in Editor in its details on ClickHouse activity.
Every query in the log, grouped by its text. There is no threshold. The view sorts them by Total Duration, the sum of all their runs. Check Total Memory and Total Read as well.
The count covers every run the log holds. The Period selects queries by Last Seen, the time each one last ran. A query whose last run falls in the period shows all of its runs, including the earlier ones.
Exporting the Query Management view needs Export Audit Log, which the Audit Log Manager preset includes. The Repeated, Failed and High Maintenance views always show the export button, and they need only View Query Management.
Yes. The User column shows the database user that ran each query. In Repeated, Failed and High Maintenance, the Users column lists everyone who ran the query.
Click Live ClickHouse at the top right of the Query Management tab, or open ClickHouse > Queries. You need View Active Queries. To stop a running query, you need Stop Active Queries. See ClickHouse activity.
A row opens only when it carries something to show: an error or an exception, or values in fields that are shown only in the details, such as the tables the query read. Rows without any of those do not open. To close an open panel, click the row again.
Yes. The Query cell of each row has a copy control that puts the SQL on your clipboard, and a control that opens the full SQL in a preview titled Query. You can also open the row and use the copy control in its Query section. Paste the SQL into a console in the Editor to run it.
Yes, some Minds do. When you ask a Lake Builder or Warehouse Builder Mind whether tables are still used, it reads the user and system query rows of the log, filtering by date, user or table name as needed, and it leaves out the system table-change rows. It refuses the check if you do not hold View Query Management.