> ## Documentation Index
> Fetch the complete documentation index at: https://docs.firebolt.io/llms.txt
> Use this file to discover all available pages before exploring further.

> Use this reference to learn about the metadata available for historical queries in Firebolt.

# Engine user query history

The system table `information_schema.engine_user_query_history` is a view, which is a virtual table based on [ENGINE\_QUERY\_HISTORY](/reference-sql/information-schema/engine-query-history). It applies filters to only show queries that were made by actual users.

Queries generated by the system, such as those from connectors, drivers, or SDKs, are marked with the boolean HTTP header `Firebolt-Machine-Query`. These system queries can include actions such UI page loads or query progress updates.
These queries do not appear in `information_schema.engine_user_query_history`, but are available in [ENGINE\_QUERY\_HISTORY](/reference-sql/information-schema/engine-query-history), which acts as a complete audit log.

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT
  *
FROM
  information_schema.engine_user_query_history
LIMIT
  100;
```

## Columns in information\_schema.engine\_user\_query\_history

Each row contains columns with detailed information about each query in the history. This schema has the same structure and information as [ENGINE\_QUERY\_HISTORY](/reference-sql/information-schema/engine-query-history).

| Column Name                   | Data Type   | Description                                                                                                                                                                                                                                                                                                                 |
| :---------------------------- | :---------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| account\_name                 | TEXT        | The name of the account that ran the query.                                                                                                                                                                                                                                                                                 |
| user\_name                    | TEXT        | The user name that was used to run the query. The `user_name` is present for account-level operations, and `NULL` for organization-level operations.                                                                                                                                                                        |
| login\_name                   | TEXT        | The login name that was used to run the query. The `login_name` is present for organization-level statements, and otherwise `NULL`.                                                                                                                                                                                         |
| service\_account\_name        | TEXT        | The service account name that was used to run the query. The `service_account_name` is present for organization-level statements, and otherwise `NULL`.                                                                                                                                                                     |
| submitted\_time               | TIMESTAMPTZ | The time that the user submitted the query.                                                                                                                                                                                                                                                                                 |
| start\_time                   | TIMESTAMPTZ | The time that the query started running in Coordinated Universal Time (UTC).                                                                                                                                                                                                                                                |
| end\_time                     | TIMESTAMPTZ | The time that the query stopped running in UTC.                                                                                                                                                                                                                                                                             |
| duration\_us                  | BIGINT      | The duration of query run time in microseconds.                                                                                                                                                                                                                                                                             |
| e2e\_duration\_us             | BIGINT      | The end-to-end duration of query run time. Starting from the time the query was submitted and ending when the result was fully returned in microseconds.                                                                                                                                                                    |
| status                        | TEXT        | Can be one of the following values:<br />`STARTED_EXECUTION`–Successful start of query execution.<br />`ENDED_SUCCESSFULLY`–Successful end of query execution.<br />`CANCELED_EXECUTION`–Query was canceled.<br />`PARSE_ERROR`–Query could not be parsed.<br />`EXECUTION_ERROR`–Query could not be executed successfully. |
| request\_id                   | TEXT        | The ID of the request from which the query originates.                                                                                                                                                                                                                                                                      |
| query\_id                     | TEXT        | The unique identifier of the SQL query.                                                                                                                                                                                                                                                                                     |
| query\_label                  | TEXT        | A user-provided query label.                                                                                                                                                                                                                                                                                                |
| query\_text                   | TEXT        | The text of the SQL statement.                                                                                                                                                                                                                                                                                              |
| query\_text\_normalized       | TEXT        | The normalized text of the SQL statement.                                                                                                                                                                                                                                                                                   |
| query\_text\_normalized\_hash | TEXT        | The hash of the normalized text of the SQL statement.                                                                                                                                                                                                                                                                       |
| telemetry                     | TEXT        | Displays additional telemetry information about the query in JSON format. Currently, only `SELECT` queries and `VACUUM` jobs provide telemetry.                                                                                                                                                                             |
| error\_message                | TEXT        | The returned error message.                                                                                                                                                                                                                                                                                                 |
| scanned\_rows                 | BIGINT      | The total number of rows scanned.                                                                                                                                                                                                                                                                                           |
| scanned\_bytes                | BIGINT      | The total number of uncompressed bytes scanned.                                                                                                                                                                                                                                                                             |
| scanned\_cache\_bytes         | BIGINT      | The total number of compressed bytes scanned from disk-based cache.                                                                                                                                                                                                                                                         |
| scanned\_storage\_bytes       | BIGINT      | The total number of compressed bytes scanned from Firebolt-managed storage. Does not apply to [EXTERNAL tables](/overview/indexes#external-tables).                                                                                                                                                                         |
| inserted\_rows                | BIGINT      | The total number of rows written.                                                                                                                                                                                                                                                                                           |
| inserted\_bytes               | BIGINT      | The total number of bytes written to both cache and storage.                                                                                                                                                                                                                                                                |
| spilled\_bytes                | BIGINT      | The total number of uncompressed bytes spilled.                                                                                                                                                                                                                                                                             |
| peak\_memory\_bytes           | BIGINT      | Peak memory usage by the query. For distributed queries represents the peak memory used by any node.                                                                                                                                                                                                                        |
| returned\_rows                | BIGINT      | The total number of rows returned from the query.                                                                                                                                                                                                                                                                           |
| returned\_bytes               | BIGINT      | The total number of bytes returned from the query.                                                                                                                                                                                                                                                                          |
| time\_in\_queue\_us           | BIGINT      | The number of microseconds the query spent in queue.                                                                                                                                                                                                                                                                        |
| retries                       | BIGINT      | The number of retried attempts in case of query failure. Defaults to 0.                                                                                                                                                                                                                                                     |
| node\_ordinal                 | INTEGER     | Index of the node in the cluster that has received the query and manages the execution of it. (1-indexed)                                                                                                                                                                                                                   |
| cluster\_ordinal              | INTEGER     | Index of the cluster in the engine that has received the query and executes it. (1-indexed)                                                                                                                                                                                                                                 |
| number\_of\_clusters          | INTEGER     | Number of cluster in the engine at the point of query execution.                                                                                                                                                                                                                                                            |
