> For the complete documentation index, see [llms.txt](https://docs.e6data.com/query-engine/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.e6data.com/query-engine/guides/querying/query-history-and-saved-queries.md).

# Query history and saved queries

Review every query run in a workspace in Run History - timing, status, user, and query text - and get query counts programmatically.

Every query run in the workspace is recorded in **Run History**, accessible from the left navigation of the Compute Plane. Use it for debugging slow queries, auditing access, cost attribution, and finding patterns.

## What's recorded

| Field          | Description                                                             |
| -------------- | ----------------------------------------------------------------------- |
| Query ID       | Unique identifier (copy this when contacting support)                   |
| User           | Who ran the query                                                       |
| Cluster        | Which cluster executed it                                               |
| Catalog        | Primary catalog used                                                    |
| Status         | Success, Failed, Timed out, Cancelled                                   |
| Submitted at   | When the query arrived                                                  |
| Started at     | When execution began (may differ if the cluster was scaling)            |
| Duration       | End-to-end time                                                         |
| Bytes scanned  | Data read from storage                                                  |
| Rows returned  | Result set size                                                         |
| Cache          | Hit, Miss, or Bypass                                                    |
| Execution mode | Standard or Native                                                      |
| Access method  | UI, JDBC, REST, PG protocol, and so on                                  |
| Query text     | The SQL submitted (and the translated SQL if the transpiler is enabled) |

## Filtering and searching

Run History supports filters by time (last hour, day, week, or custom range), user, cluster, status, and access method, plus full-text search within query text. Combine them for targeted investigation - for example, "all failed JDBC queries from `bi-service-account` in the last 24 hours."

Click a query to drill into its full text, execution plan (if available), per-stage resource usage, error details, and the cluster state at execution time. Copy the Query ID to share with e6data support.

## Common workflows

* **Debug a slow query:** filter by status `Success`, sort by duration descending, open the slowest queries, and look for full table scans, missing partition pruning, or large joins without predicates.

## Exporting and retention

Export filtered query history to CSV or to your data warehouse via the [REST API](/query-engine/developers/connecting-to-the-engine/rest-api-for-sql.md).

## See also

* [Observability export](/query-engine/guides/operations/monitoring/observability-export.md)
* [Monitoring](/query-engine/guides/operations/monitoring.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.e6data.com/query-engine/guides/querying/query-history-and-saved-queries.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
