Download PDFSubmit Feedback

  • Privileges
  • kwdb_internal.audit_policies
  • kwdb_internal.audit_trail
  • kwdb_internal.cluster_sessions
  • kwdb_internal.gossip_nodes
  • kwdb_internal.metrics_metadata
  • kwdb_internal.node_metrics
  • kwdb_internal.node_statement_statistics
  • kwdb_internal.processes
  • kwdb_internal.role_options
  • kwdb_internal.table_columns
  • kwdb_internal.table_indexes
  • kwdb_internal.tables
  • kwdb_internal.user_login_status

kwdb_internal

The kwdb_internal schema contains system views that describe the database's internal objects, processes, and metrics.

To list all system views in the kwdb_internal schema, use the SQL statement SHOW TABLES FROM [<database_name>.]kwdb_internal;. If no database is specified, the current database is used by default. To view data from specific system views, use standard SELECT statements.

This section lists commonly used system views in the kwdb_internal schema.

Privileges

The user must be a member of the admin role. By default, the root user belongs to the admin role.

kwdb_internal.audit_policies

The kwdb_internal.audit_policies system view describes audit policies.

Column NameData TypeDescription
audit_nameSTRINGThe name of the audit policy.
target_typeSTRINGThe type of audit target (e.g., users, roles, databases, tables, views, indexes, constraints, sequences, privileges, ranges, queries, jobs, sessions, statistics, audits, properties).
target_nameSTRINGThe name of the audit target.
target_idINTThe ID of the audit target.
operationsSTRINGThe audited operation(s).
operatorsSTRINGThe user(s) performing the audited operation.
conditionINTReserved field. The audit condition.
wheneverSTRINGThe audit trigger condition (when the audit is recorded).
actionINTReserved field. The post-audit operations.
levelINTReserved field. The audit level.
enableBOOLWhether the audit policy is enabled.

kwdb_internal.audit_trail

The kwdb_internal.audit_trail system view describes audit log information.

Column NameData TypeDescription
event_timeTIMESTAMPThe time when the audit event occurred.
usernameSTRINGThe user name.
operationSTRINGThe type of operation performed on the audit target.
target_typeSTRINGThe type of audit target.
resultSTRINGThe execution result of the audit event. OK indicates success; FAIL indicates failure.
detailSTRINGAdditional audit information.

kwdb_internal.cluster_sessions

The kwdb_internal.cluster_sessions system view describes cluster session information.

Column NameData TypeDescription
node_idINT8The ID of the node to which the session is connected.
session_idSTRINGThe session ID.
user_nameSTRINGThe name of the user who initiated the session.
client_addressSTRINGThe client address that initiated the session.
application_nameSTRINGThe name of the application that initiated the session.
active_queriesSTRINGActive SQL queries in the session.
last_active_querySTRINGThe most recently completed SQL query in the session.
session_startTIMESTAMPThe timestamp when the session started.
oldest_query_startTIMESTAMPThe timestamp when the earliest active SQL query in the session started.
kv_txnSTRINGThe ID of the current key-value transaction in the session.
alloc_bytesINT8The number of bytes allocated by the session.
max_alloc_bytesINT8The maximum number of bytes allocated by the session.
connection_idSTRINGThe session connection ID.
schemaSTRINGThe default schema.
statusSTRINGThe session status.

kwdb_internal.gossip_nodes

The kwdb_internal.gossip_nodes system view describes information about nodes in the cluster gossip network.

Column NameData TypeDescription
node_idINT8The node ID.
networkSTRINGThe network protocol type.
addressSTRINGThe node address.
advertise_addressSTRINGThe advertised address.
sql_networkSTRINGThe SQL network protocol type.
sql_addressSTRINGThe SQL service address.
advertise_sql_addressSTRINGThe advertised SQL address.
attrsJSONBThe node attributes.
localitySTRINGThe node ID.
start_modeSTRINGThe startup mode.
cluster_nameSTRINGThe cluster name.
server_versionSTRINGThe server version.
build_tagSTRINGThe build tag.
started_atTIMESTAMPThe startup time.
is_liveBOOLWhether the node is alive.
rangesINT8The number of data ranges.
leasesINT8The number of leases.

kwdb_internal.metrics_metadata

The kwdb_internal.metrics_metadata system view describes metadata of monitoring metrics.

Column NameData TypeDescription
nameSTRINGThe name of the metric.
helpSTRINGThe description of the metric.
measurementSTRINGThe measurement type of metric.
unitSTRINGThe unit of measurement for metric.

kwdb_internal.node_metrics

The kwdb_internal.node_metrics system view describes metrics data for nodes in the cluster.

Column NameData TypeDescription
store_idINT8The storage ID.
nameSTRINGThe metric name.
valueFLOAT8The metric value.

kwdb_internal.node_statement_statistics

The kwdb_internal.node_statement_statistics system view describes statistics related to statement execution on nodes.

Column NameData TypeDescription
node_idINT8The node ID.
application_nameSTRINGThe application name.
flagsSTRINGThe flags.
keySTRINGThe key of the SQL statement.
anonymizedSTRINGThe anonymized SQL statement.
countINT8The number of executions.
first_attempt_countINT8The number of first-attempt executions.
max_retriesINT8The maximum number of retries.
last_errorSTRINGThe last error message.
rows_avgFLOAT8The average number of rows returned.
rows_varFLOAT8The variance of rows returned.
parse_lat_avgFLOAT8The average parse latency.
parse_lat_varFLOAT8The variance of parse latency.
plan_lat_avgFLOAT8The average plan latency.
plan_lat_varFLOAT8The variance of plan latency.
run_lat_avgFLOAT8The average run latency.
run_lat_varFLOAT8The variance of run latency.
service_lat_avgFLOAT8The average service latency.
service_lat_varFLOAT8The variance of service latency.
overhead_lat_avgFLOAT8The average overhead latency.
overhead_lat_varFLOAT8The variance of overhead latency.
bytes_readINT8The number of bytes read.
rows_readINT8The number of rows read.
implicit_txnBOOLWhether it is an implicit transaction.
failed_countINT8The number of failures.
user_nameSTRINGThe user name.
databaseSTRINGThe database name.

kwdb_internal.processes

The kwdb_internal.processes system view describes database process information.

Column NameData TypeDescription
process_idINT8The process ID.
node_idINT8The ID of the node to which the process belongs.
process_nameSTRINGThe process name.
process_typeSTRINGThe process type.
os_userSTRINGThe OS user who started the process.
memoryINT8The memory cache size.
createdINT8The process startup time.

kwdb_internal.role_options

The kwdb_internal.role_options system view describes user options.

Column NameData TypeDescription
usernameSTRINGThe user name.
optionSTRINGThe user option.
valueSTRINGThe value of the user option.

kwdb_internal.table_columns

The kwdb_internal.table_columns system view describes column information for all tables in the database.

Column NameData TypeDescription
descriptor_idINT8The table descriptor ID.
descriptor_nameSTRINGThe table name.
column_idINT8The column ID.
column_nameSTRINGThe column name.
column_typeSTRINGThe column type.
nullableBOOLWhether the column allows NULL values.
default_exprSTRINGThe default value expression.
hiddenBOOLWhether the column is hidden.

kwdb_internal.table_indexes

The kwdb_internal.table_indexes system view describes index information for all tables in the database.

Column NameData TypeDescription
descriptor_idINT8The table descriptor ID.
descriptor_nameSTRINGThe table name.
index_idINT8The index ID.
index_nameSTRINGThe index name.
index_typeSTRINGThe index type.
is_uniqueBOOLWhether the index is unique.
is_invertedBOOLWhether the index is inverted.

kwdb_internal.tables

The kwdb_internal.tables system view describes metadata information for all tables in the database.

Column NameData TypeDescription
table_idINT8The unique identifier of the table.
parent_idINT8The identifier of the parent object.
nameSTRINGThe table name.
database_nameSTRINGThe database name.
versionINT8The version number of the table.
mod_timeTIMESTAMPThe last modification time.
mod_time_logicalDECIMALThe logical modification timestamp.
format_versionSTRINGThe table format version.
stateSTRINGThe table state (e.g., PUBLIC, DROP).
sc_lease_node_idINT8The ID of the node holding the schema change lease.
sc_lease_expiration_timeTIMESTAMPThe expiration time of the schema change lease.
drop_timeTIMESTAMPThe table drop time.
audit_modeSTRINGThe audit mode.
schema_nameSTRINGThe schema name.

kwdb_internal.user_login_status

The kwdb_internal.user_login_status system view describes users' current login information, historical login records, failed login statistics, and account status.

Column NameData TypeDescription
usernameSTRINGThe user login name.
login_timeTIMESTAMPThe current login time.
login_applicationSTRINGThe application system of the current login.
login_hostSTRINGThe IP address of the current login.
login_methodSTRINGThe login method used for the current login.
login_node_idINT8The node ID of the current login.
last_login_timeTIMESTAMPThe time of the last successful login.
last_login_applicationSTRINGThe application system of the last successful login.
last_login_hostSTRINGThe IP address of the last successful login.
last_login_methodSTRINGThe login method used for the last successful login.
last_login_node_idINT8The node ID of the last successful login.
failed_login_timeTIMESTAMPThe time of the most recent failed login attempt.
failed_login_applicationSTRINGThe application system of the most recent failed login attempt.
failed_login_hostSTRINGThe IP address of the most recent failed login attempt.
failed_login_methodSTRINGThe login method used for the most recent failed login attempt.
failed_login_node_idINT8The node ID of the most recent failed login attempt.
failed_attemptsINT8The cumulative number of failed login attempts.
first_loginBOOLWhether this is the user's first login.
latest_statusSTRINGThe current login status of the user.