gv$sql_audit

2023-08-18 09:26:34  Updated

Overview

gv$sql_audit displays the statistics about each SQL request on all servers, such as the source and execution status. This view is tenant-specific, and only the system tenant can query the gv$sql_audit view of other tenants.

__all_virtual_sql_audit

Field description

Field name Type Nullable Description
SVR_IP varchar(32) No The IP address of the OBServer.
SVR_PORT BIGINT(20) No The port number of the OBServer.
REQUEST_ID BIGINT(20) No The ID of the request.
TRACE_ID varchar(128) No The trace ID of the statement.
SID BIGINT(20) UNSIGNED No The ID of the session connection.
CLIENT_IP varchar(32) No The IP address of the client that sent the request.
CLIENT_PORT BIGINT(20) No The port number of the client that sent the request.
TENANT_ID BIGINT(20) No The ID of the tenant that sent the request.
TENANT_NAME varchar(64) No The name of the tenant that sent the request.
EFFECTIVE_TENANT_ID BIGINT(20) No The ID of the tenant.
USER_ID BIGINT(20) No The ID of the user that sent the request.
USER_NAME varchar(64) No The username of the user that sent the request.
USER_CLIENT_IP varchar(32) No The IP address of the client that sent the request.
DB_ID BIGINT(20) UNSIGNED DB_ID The ID of the database.
DB_NAME varchar(128) DB_NAME The name of the database.
SQL_ID varchar(32) No The ID of the SQL statement.
QUERY_SQL varchar(65536) No The actual SQL statement.
PLAN_ID BIGINT(20) No The ID of the execution plan.
AFFECTED_ROWS BIGINT(20) No The number of rows affected.
RETURN_ROWS BIGINT(20) No The number of rows returned.
PARTITION_CNT BIGINT(20) No The number of partitions in the request.
RET_CODE BIGINT(20) No The return code of the execution.
QC_ID BIGINT(20) UNSIGNED No The ID of the scheduler in the parallel execution scenario.
DFO_ID BIGINT(20) No The ID of the sub-plan being executed in the parallel execution scenario.
SQC_ID BIGINT(20) No The ID of the local coordinator in the parallel execution scenario.
WORKER_ID BIGINT(20) No The ID of the worker thread in the parallel execution scenario.
EVENT varchar(64) No The name of the wait event with the longest wait time.
P1TEXT varchar(64) No The first parameter of the wait event.
P1 BIGINT(20) UNSIGNED No The value of the first parameter of the wait event.
P2TEXT varchar(64) No The second parameter of the wait event.
P2 BIGINT(20) UNSIGNED No The value of the second parameter of the wait event.
P3TEXT varchar(64) No The third parameter of the wait event.
P3 BIGINT(20) UNSIGNED No The value of the third parameter of the wait event.
LEVEL BIGINT(20) No The level of the wait event.
WAIT_CLASS_ID BIGINT(20) No The ID of the class to which the wait event belongs.
WAIT_CLASS# BIGINT(20) No The subscript of the class to which the wait event belongs.
WAIT_CLASS varchar(64) No The name of the class to which the wait event belongs.
STATE varchar(19) No The state of the wait event.
WAIT_TIME_MICRO BIGINT(20) No The wait time of the wait event in microseconds.
TOTAL_WAIT_TIME_MICRO BIGINT(20) No The total wait time in microseconds during execution.
TOTAL_WAITS BIGINT(20) No The total number of waits during the execution.
RPC_COUNT BIGINT(20) No The number of remote procedure calls (RPCs) sent.
PLAN_TYPE BIGINT(20) No The type of the execution plan. Valid values:
  • local
  • remote
  • distribute
  • IS_INNER_SQL TINYINT(4) No Indicates whether the request is an internal SQL request.
    IS_EXECUTOR_RPC TINYINT(4) No Indicates whether the current request is an RPC request.
    IS_HIT_PLAN TINYINT(4) No Indicates whether the plan cache is hit.
    REQUEST_TIME BIGINT(20) No The time when the execution started.
    ELAPSED_TIME BIGINT(20) No The amount of time elapsed from when the request was received to when the execution of the request ended.
    NET_TIME BIGINT(20) No The amount of time elapsed from when the RPC was sent to when the request was received.
    NET_WAIT_TIME BIGINT(20) No The amount of time elapsed from when the request was received to when it entered the queue.
    QUEUE_TIME BIGINT(20) No The wait time of the request in the queue.
    DECODE_TIME BIGINT(20) No The time spent on decoding the request after it left the queue.
    GET_PLAN_TIME BIGINT(20) No The amount of time elapsed from when the processing started to when the plan was obtained.
    EXECUTE_TIME BIGINT(20) No The time consumed for plan execution.
    APPLICATION_WAIT_TIME BIGINT(20) UNSIGNED No The total amount of time spent on waiting for events of the application class.
    CONCURRENCY_WAIT_TIME BIGINT(20) UNSIGNED No The total amount of time spent on waiting for events of the concurrency class.
    USER_IO_WAIT_TIME BIGINT(20) UNSIGNED No The total amount of time spent on waiting for events of the user_io class.
    SCHEDULE_TIME BIGINT(20) UNSIGNED No The total amount of time spent on events of the schedule class.
    ROW_CACHE_HIT BIGINT(20) No The number of row cache hits.
    BLOOM_FILTER_CACHE_HIT BIGINT(20) No The number of Bloom Filter cache hits.
    BLOCK_CACHE_HIT BIGINT(20) No The number of block cache hits.
    BLOCK_INDEX_CACHE_HIT BIGINT(20) No The number of block index cache hits.
    DISK_READS BIGINT(20) No The number of physical reads.
    RETRY_CNT BIGINT(20) No The number of retries.
    TABLE_SCAN TINYINT(4) No Indicates whether the request contains a full table scan.
    CONSISTENCY_LEVEL BIGINT(20) No The consistency level.
    MEMSTORE_READ_ROW_COUNT BIGINT(20) No The number of rows read in the memstore.
    SSSTORE_READ_ROW_COUNT BIGINT(20) No The number of rows consecutively read in SSStore.
    REQUEST_MEMORY_USED BIGINT(20) No The memory consumed by the request.
    EXPECTED_WORKER_COUNT BIGINT(20) No The number of worker threads expected by the request.
    USED_WORKER_COUNT BIGINT(20) No The number of worker threads actually used by the request.
    SCHED_INFO varchar(16384) No The scheduling information of the request.
    FUSE_ROW_CACHE_HIT BIGINT(20) No At present, this field is not supported and is NULL by default.
    PS_STMT_ID BIGINT(20) No The ID of the PREPARE statement corresponding to the request.
    TRANSACTION_HASH BIGINT(20) UNSIGNED No The hash value of the transaction corresponding to the request.
    REQUEST_TYPE BIGINT(20) No The type of the request. Valid values:
  • 0: indicates an invalid request.
  • 1: indicates an internal request.
  • 2: indicates a local request, for example, a local plan.
  • 3: indicates a remote request.
  • 4: indicates a distributed request.
  • 5: indicates an SQL statement PREPARE request.
  • 6: indicates an SQL EXECUTE stmt request.
  • IS_BATCHED_MULTI_STMT TINYINT(4) No Indicates whether optimization has been performed for batch execution of multiple statements.
    OB_TRACE_INFO varchar(4096) No The trace information configured by the user.
    PLAN_HASH BIGINT(20) UNSIGNED No The hash value of the execution plan.
    LOCK_FOR_READ_TIME BIGINT(20) No The time in microseconds spent on waiting for locked data to be unlocked before it can be read.
    WAIT_TRX_MIGRATE_TIME BIGINT(20) No When wait events must be frozen due to the inner compaction mechanism during data writes, unfinished transactions must be migrated. This field indicates the time in microseconds required for migrating the unfinished transactions.

    Contact Us