audit_log
Inspect statement audit records to investigate execution, errors, and resource usage.
These are service-maintained tables. Use them for inspection and contact VeloDB Cloud support before changing their schema, properties, or data.
Run the query in the warehouse SQL Editor or a connected SQL client:
SELECT * FROM __internal_schema.audit_log LIMIT 10;
Database
__internal_schema
Table information
| Column name | Type | Description |
|---|---|---|
query_id | varchar(128) | Query identifier. |
time | datetime(3) | Statement execution time, with millisecond precision. |
client_ip | varchar(128) | Client IP address recorded for the statement. |
user | varchar(128) | Warehouse SQL user. |
frontend_ip | varchar(1024) | Connected frontend address. |
catalog | varchar(128) | Current catalog. |
db | varchar(128) | Current SQL database. |
state | varchar(128) | Statement execution status. |
error_code | int | Error code, if execution failed. |
error_message | string | Execution error message. |
query_time | bigint | Statement execution duration in milliseconds. |
queue_time_ms | bigint | Time spent waiting in a query queue, in milliseconds. |
cpu_time_ms | bigint | Cumulative backend CPU time in milliseconds. |
peak_memory_bytes | bigint | Peak memory usage in bytes. |
scan_bytes | bigint | Bytes scanned. |
scan_rows | bigint | Rows scanned. |
return_rows | bigint | Rows returned. |
shuffle_send_rows | bigint | Rows transferred between compute nodes. |
shuffle_send_bytes | bigint | Bytes transferred between compute nodes. |
spill_write_bytes_from_local_storage | bigint | Bytes written to local spill storage. |
spill_read_bytes_from_local_storage | bigint | Bytes read from local spill storage. |
scan_bytes_from_local_storage | bigint | Bytes scanned from local storage. |
scan_bytes_from_remote_storage | bigint | Bytes scanned from remote storage. |
parse_time_ms | int | SQL parse time in milliseconds. |
plan_times_ms | map<string,int> | Planning phase durations in milliseconds. |
get_meta_times_ms | map<string,int> | Metadata retrieval durations in milliseconds. |
schedule_times_ms | map<string,int> | Scheduling phase durations in milliseconds. |
hit_sql_cache | tinyint | Whether the statement used the SQL cache. |
handled_in_fe | tinyint | Whether the frontend handled the statement without backend execution. |
queried_tables_and_views | array<string> | Tables and views referenced by the statement. |
chosen_m_views | array<string> | Materialized views selected for the statement. |
changed_variables | map<string,string> | System variables changed for the statement. |
sql_mode | string | SQL mode used by the statement. |
stmt_type | varchar(48) | Statement type. |
stmt_id | bigint | Statement identifier. |
sql_hash | varchar(128) | Statement hash. |
sql_digest | varchar(128) | Normalized statement digest. |
is_query | tinyint | Whether the statement is a query. |
is_nereids | tinyint | Whether the Nereids optimizer was used. |
is_internal | tinyint | Whether the statement is an internal statement. |
workload_group | string | Workload group used by the statement. |
compute_group | string | Compute group (cluster) used by the statement. |
stmt | string | Statement text. |
Use DESCRIBE __internal_schema.audit_log; to inspect the schema in your warehouse.
Retention
The audit table uses time partitions. Inspect its current properties with:
SHOW CREATE TABLE __internal_schema.audit_log;
For day-based dynamic partitions, a setting such as "dynamic_partition.start" = "-30" defines a start boundary 30 days before the current day. It does not guarantee that every statement in that window was captured.
Ask VeloDB Cloud support to confirm or change the retention policy for your warehouse. Longer retention consumes more storage and can increase the data scanned by audit queries.
Field details
client_ip: A proxy address can appear when client IP forwarding is unavailable.state:EOFindicates successful query execution.OKindicates successful DDL or DML execution.ERRindicates a failed statement.query_time,queue_time_ms, andcpu_time_msare durations in milliseconds. They are not clock timestamps.