Information schema for 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. 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, which acts as a complete audit log.
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.
Column Name | Data Type | Description |
---|---|---|
account_name | TEXT | The name of the account in which the query was run. |
user_name | TEXT | The user name used to run the query. The user name is provided for account-level operations but is NULL for organization-level operations. |
login_name | TEXT | The login name that was used to run the query. The login_name is provided for organization-level statements, and is otherwise NULL . |
service_account_name | TEXT | The service account name that was used to run the query. The service_account_name is provided for organization-level statements, and otherwise NULL . |
submitted_time | TIMESTAMPTZ | The time that the query was submitted by the user. |
start_time | TIMESTAMPTZ | The query start time in Coordinated Universal Time (UTC). |
end_time | TIMESTAMPTZ | The query completion time in UTC. |
duration_us | BIGINT | The duration of query run time. (microseconds). |
status | TEXT | Possible values include:STARTED_EXECUTION – The query started successfully.ENDED_SUCCESSFULLY – The query completed successfully.CANCELED_EXECUTION – The query was canceled. PARSE_ERROR – The query could not be parsed.EXECUTION_ERROR – The query failed during runtime. |
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. |
error_message | TEXT | The returned error message. |
scanned_rows | BIGINT | The total number of rows scanned. |
scanned_bytes | BIGINT | The total number of bytes scanned from both cache and storage. |
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. |
total_ram_consumed | BIGINT | The total number of bytes in RAM consumed by the engine during the query process. |
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 total number of retries to run a given query after a failure. By default, the number of retries is 0 , and the number increases with each retry. |