Skip to main content
VeloDB Cloud 26.x is based on Apache Doris 4.x. See Version Mapping.

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 nameTypeDescription
query_idvarchar(128)Query identifier.
timedatetime(3)Statement execution time, with millisecond precision.
client_ipvarchar(128)Client IP address recorded for the statement.
uservarchar(128)Warehouse SQL user.
frontend_ipvarchar(1024)Connected frontend address.
catalogvarchar(128)Current catalog.
dbvarchar(128)Current SQL database.
statevarchar(128)Statement execution status.
error_codeintError code, if execution failed.
error_messagestringExecution error message.
query_timebigintStatement execution duration in milliseconds.
queue_time_msbigintTime spent waiting in a query queue, in milliseconds.
cpu_time_msbigintCumulative backend CPU time in milliseconds.
peak_memory_bytesbigintPeak memory usage in bytes.
scan_bytesbigintBytes scanned.
scan_rowsbigintRows scanned.
return_rowsbigintRows returned.
shuffle_send_rowsbigintRows transferred between compute nodes.
shuffle_send_bytesbigintBytes transferred between compute nodes.
spill_write_bytes_from_local_storagebigintBytes written to local spill storage.
spill_read_bytes_from_local_storagebigintBytes read from local spill storage.
scan_bytes_from_local_storagebigintBytes scanned from local storage.
scan_bytes_from_remote_storagebigintBytes scanned from remote storage.
parse_time_msintSQL parse time in milliseconds.
plan_times_msmap<string,int>Planning phase durations in milliseconds.
get_meta_times_msmap<string,int>Metadata retrieval durations in milliseconds.
schedule_times_msmap<string,int>Scheduling phase durations in milliseconds.
hit_sql_cachetinyintWhether the statement used the SQL cache.
handled_in_fetinyintWhether the frontend handled the statement without backend execution.
queried_tables_and_viewsarray<string>Tables and views referenced by the statement.
chosen_m_viewsarray<string>Materialized views selected for the statement.
changed_variablesmap<string,string>System variables changed for the statement.
sql_modestringSQL mode used by the statement.
stmt_typevarchar(48)Statement type.
stmt_idbigintStatement identifier.
sql_hashvarchar(128)Statement hash.
sql_digestvarchar(128)Normalized statement digest.
is_querytinyintWhether the statement is a query.
is_nereidstinyintWhether the Nereids optimizer was used.
is_internaltinyintWhether the statement is an internal statement.
workload_groupstringWorkload group used by the statement.
compute_groupstringCompute group (cluster) used by the statement.
stmtstringStatement 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: EOF indicates successful query execution. OK indicates successful DDL or DML execution. ERR indicates a failed statement.
  • query_time, queue_time_ms, and cpu_time_ms are durations in milliseconds. They are not clock timestamps.