Details of fields in SQL audit logs for PolarDB-X 1.0

更新时间:
复制 MD 格式

This topic describes the fields in the SQL audit logs for PolarDB-X 1.0.

Field name

Field description

__topic__

The log topic. The format is drds_audit_log_{instance_id}_{db_name}. For example, drds_audit_log_drdsxyzabcd_demo_drds_db.

instance_id

The ID of the PolarDB-X 1.0 instance.

db_name

The name of the PolarDB-X 1.0 database.

user

The username used to execute the SQL statement.

client_ip

The IP address of the client that accesses the PolarDB-X 1.0 instance.

client_port

The port of the client that accesses the PolarDB-X 1.0 instance.

sql

The SQL statement that was executed.

trace_id

The trace ID of the SQL execution.

For a transaction, the ID is the trace ID followed by a - character and a number, such as drdsabcdxyz-1, drdsabcdxyz-2, and so on.

sql_code

The hash value of the template SQL.

hint

The hint for the SQL execution.

logical_cpu_time

The total CPU time used for SQL execution. Unit: ns.

logical_opt_cpu_time

The total CPU time used to generate the execution plan. Unit: ns.

logical_exec_cpu_time

The total CPU time consumed to generate the execution plan, in ns.

table_name

The names of the tables involved in the query. Multiple table names are separated by commas (,).

sql_type

The SQL type. Valid values: Select, Insert, Update, Delete, Set, Alter, Create, Drop, Truncate, Replace, and Other.

sql_type_detail

The name of the SQL Resolver.

sql_time

The time when the SQL statement started to execute. The format is yyyy-MM-dd HH:mm:ss.SSS.

response_time

The response time. Unit: milliseconds (ms).

affect_rows

The number of rows returned by the SQL execution.

  • For DML statements such as INSERT, DELETE, and UPDATE, this field indicates the number of affected rows.

  • For query statements, this field indicates the number of returned rows.

fail

Indicates whether the SQL execution failed.

A value of 0 indicates success. Other values indicate failure.

fetched_rows

The number of record rows pulled from storage.

memory_reject

Indicates whether the execution failed due to an out of memory error. Valid values:

  • 0: No

  • 1: Yes

spm_baseline_id

The corresponding baseline ID in SQL Plan Management (SPM).

spm_plan_id

The corresponding execution plan ID in SPM.

total_physical_conn_time

The physical connection time for the SQL statement. Unit: ns.

total_physical_exec_time

The physical execution time for the SQL statement. Unit: ns.

total_physical_read_time

The physical read time for the SQL statement. Unit: ns.

total_physical_time

The total physical time for the SQL statement. This is the sum of the physical connection time and the physical execution time. Unit: ns.