All Products
Search
Document Center

PolarDB:Fields in logs

Last Updated:Aug 18, 2023

This topic describes the fields that are included in audit logs of PolarDB-X databases.

FieldTypeDescription
__topic__stringThe topic of the log. The value is polardbx_sqlaudit.
affect_rowsint
  • If a DML statement is executed, this field indicates the number of rows on which the operation is performed.
  • If a query statement is executed, this field indicates the number of data rows that are returned.
autocommitintThis field indicates whether the autocommit mode is enabled when the SQL statement is executed. Valid values:
  • 0: The autocommit mode is disabled.
  • 1 or NULL: The autocommit mode is enabled.
client_ipstringThe IP address of the client that accesses the PolarDB-X instance.
client_portintThe port over which the client accesses the PolarDB-X instance.
db_namestringThe name of the database.
failintThis field indicates whether the SQL query failed. Valid values:
  • 0: The SQL query is successful.
  • 1: The SQL query failed.
fetched_rowsintThe number of rows that are retrieved from data nodes.
hintstringThe hint that is included in the SQL statement.
instance_idstringThe ID of the PolarDB-X instance.
memory_rejectintThis field indicates whether the execution failed due to an out-of-memory (OOM) issue. Valid values:
  • 0: indicates that the execution failure is not caused by an out-of-memory (OOM) issue.
  • 1: indicates that the execution failed due to an out-of-memory (OOM) issue.
response_timeintThe response time. Unit: ms.
spm_baseline_idintThe ID of the SQL plan baseline in the SQL plan management (SPM) system.
spm_plan_idintThe ID of SQL plan in the SPM system.
sqlstringThe SQL statement that is executed.
sql_codestringThe hash value of the SQL template.
sql_timedatetimeThe point in time in UTC when the system started to execute the SQL statement. The timestamp is displayed in the yyyy-MM-dd HH:mm:ss.SSS format.
sql_typestringThe type of the SQL statement. Valid values:
  • SELECT
  • INSERT
  • DELETE
  • UPDATE
  • SET
  • ALTER
  • CREATE
  • DROP
  • TRUNCATE
  • REPLACE
  • OTHER
sql_type_detailstringThe name of the SQL parser.
trace_idstringThe ID of the SQL query trace.
transaction_idstringThe ID of the transaction.
transaction_policystringThe transaction policy based on which the SQL statement is executed. Valid values:
  • Empty value: The transaction processing feature is disabled.
  • TSO: Timestamp oracle (TSO) transactions are executed on the PolarDB-X database. This is the default value.
  • BEST_EFFORT: Two-phase commit (2PC) transactions are executed on the PolarDB-X database.
userstringThe name of the Resource Access Management (RAM) user who executed the SQL statement.
table_namestringThe tables on which the SQL statement is executed. Multiple table names are separated with commas (,).
workload_typestringThe type of the processor that is used when the SQL statement is executed. Valid values:
  • TP: transaction processor
  • AP: analysis processor