Purpose
You can use this statement to query information about database objects.
Syntax
SHOW {
[EXTENDED] [FULL] TABLES [{FROM | IN} database_name] [like_or_where_clause]
| {DATABASES | SCHEMAS} [STATUS] [like_or_where_clause]
| [EXTENDED] [FULL] {COLUMNS | FIELDS} {FROM | IN} rel_name [{FROM | IN} database_name] [like_or_where_clause]
| TABLE STATUS [{FROM | IN} database_name] [like_or_where_clause]
| PROCEDURE STATUS [{FROM | IN} database_name] [like_or_where_clause]
| FUNCTION STATUS [{FROM | IN} database_name] [like_or_where_clause]
| {GLOBAL | SESSION | LOCAL} VARIABLES [like_or_where_clause]
| {CHARSET | CHARACTER SET} [like_or_where_clause]
| TRACE [FORMAT='JSON']
| COLLATION [like_or_where_clause]
| PARAMETERS [like_or_where_clause] tenant_name
| [EXTENDED] {INDEX | INDEXES | KEYS} {FROM | IN} table_name [{FROM | IN} database_name] WHERE opt_hint_value expr
| [FULL] PROCESSLIST
| TABLEGROUPS [like_or_where_clause]
| {GLOBAL | SESSION | LOCAL} STATUS [like_or_where_clause]
| TENANT [STATUS]
| CREATE TENANT tenant_name
| CREATE TABLEGROUP tablegroup_name
| CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] database_name
| CREATE TABLE table_name
| CREATE VIEW view_name
| CREATE PROCEDURE proc_name
| CREATE FUNCTION func_name
| WARNINGS [LIMIT N | LIMIT N,M]
| ERRORS [LIMIT N | LIMIT N,M]
| COUNT(*) WARNINGS
| COUNT(*) ERRORS
| GRANTS opt_for_grant_user
| [STORAGE] ENGINES
| PRIVILEGES
| RECYCLEBIN
| SEQUENCE [like_or_where_clause]
| FUNCTION CODE func_name
| PROCEDURE CODE proc_name
| ENGIN engine_name {STATUS | MUTEX}
| OPEN TABLES [{FROM | IN} db_name] [LIKE 'pattern' | WHERE expr]
};
like_or_where_clause:
LIKE like_str [ESCAPE] esc_str
| WHERE expr
opt_for_grant_user:
FOR CURRENT USER
| FOR user_name
Parameters
| Parameter | Description |
|---|---|
| [EXTENDED] [FULL] TABLES {FROM | IN} database_name | Queries all tables in the database specified by database_name.
|
| {DATABASES | SCHEMAS} [STATUS] | Queries all databases in the current tenant. The STATUS keyword specifies to query the read/write attribute of the database. |
| [EXTENDED] [FULL] {COLUMNS | FIELDS} {FROM | IN} rel_name | Queries columns of the relational table specified by rel_name.
|
| TABLE STATUS [{FROM | IN} database_name] | Queries the details of all tables in the database specified by database_name. |
| PROCEDURE STATUS [{FROM | IN} database_name] | Queries the details of all stored procedures in the database specified by database_name. |
| FUNCTION STATUS [{FROM | IN} database_name] | Queries the details of all functions in the database specified by database_name. |
| {GLOBAL | SESSION | LOCAL} VARIABLES | Queries system variables. |
| {CHARSET | CHARACTER SET} | Queries supported character sets. |
| TRACE [FORMAT='JSON'] | Queries the execution status of SQL statements. You can choose to output the results in the JavaScript Object Notation (JSON) format. |
| COLLATION | Queries supported collations. |
| PARAMETERS [like_or_where_clause] tenant_name | Queries system parameters. |
| [EXTENDED] {INDEX | INDEXES | KEYS} {FROM | IN} rel_name [{FROM | IN} database_name] | Queries indexes or keys of the relational table specified by rel_name. The EXTENDED keyword specifies to query information about hidden indexes in the database. |
| [FULL] PROCESSLIST | Queries the list of processes in the current tenant. The following options are supported:
NoteYou can execute the |
| TABLEGROUPS | Queries table groups. |
| {GLOBAL | SESSION | LOCAL} STATUS | Queries the status of the session. |
| TENANT [STATUS] | Queries the name of the current tenant. The STATUS keyword specifies the read/write status of the tenant. |
| CREATE TENANT tenant_name | Queries the CREATE TENANT statement. The sys tenant can query the CREATE TENANT statements of all tenants. A user tenant can query only its own CREATE TENANT statement. |
| CREATE TABLEGROUP tablegroup_name | Queries the CREATE TABLEGROUP statement. |
| CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] database_name | Queries the CREATE DATABASE statement. The IF NOT EXISTS keyword is used to add IF NOT EXISTS to the CREATE statement. |
| CREATE TABLE table_name | Queries the CREATE TABLE statement. |
| CREATE VIEW view_name | Queries the CREATE VIEW statement. |
| CREATE PROCEDURE proc_name | Queries the CREATE PROCEDURE statement. |
| CREATE FUNCTION func_name | Queries the CREATE FUNCTION statement. |
| WARNINGS [LIMIT N | LIMIT N,M] | Queries alerts. |
| COUNT(*) WARNINGS | Queries the number of alerts. |
| ERRORS [LIMIT N | LIMIT N,M] | Queries errors. |
| COUNT(*) ERRORS | Queries the number of errors. |
| GRANTS opt_for_grant_user | Queries privileges of the specified user. If you do not specify the username, privileges of the current user are displayed. The current user can query its own privileges. To query privileges of other users, the current user must have the SELECT privilege on the mysql.user table. |
| [STORAGE] ENGINES | Queries storage engines. The storage engine of OceanBase Database is OceanBase. |
| PRIVILEGES | Queries the description of MySQL privileges. |
| RECYCLEBIN | Queries objects in the recycle bin. |
| SEQUENCE | Queries the created sequences. |
| PROCEDURE CODE proc_name | Queries the internal implementation of the proc_name stored procedure.
NoticeIn the current version, only the keyword syntax is supported. The functionality does not actually take effect. |
| FUNCTION CODE func_name | Queries the internal implementation of the func_name stored function.
NoticeIn the current version, only the keyword syntax is supported. The functionality does not actually take effect. |
| ENGIN engine_name | Queries operation information about the storage engine.
NoticeIn the current version, only the keyword syntax is supported. The functionality does not actually take effect. |
| OPEN TABLES | Queries opened tables on the server and their status information.
NoticeIn the current version, only the keyword syntax is supported. The functionality does not actually take effect. |
Examples
Query all databases in the current tenant.
obclient> SHOW DATABASES; +--------------------+ | Database | +--------------------+ | oceanbase | | information_schema | | mysql | | SYS | | LBACSYS | | ORAAUDITOR | | test | | db1 | +--------------------+Query supported character sets.
obclient> SHOW CHARSET; +---------+-----------------------+--------------------+--------+ | Charset | Description | Default collation | Maxlen | +---------+-----------------------+--------------------+--------+ | binary | Binary pseudo charset | binary | 1 | | utf8mb4 | UTF-8 Unicode | utf8mb4_general_ci | 4 | | gbk | GBK charset | gbk_chinese_ci | 2 | | utf16 | UTF-16 Unicode | utf16_general_ci | 2 | | gb18030 | GB18030 charset | gb18030_chinese_ci | 4 | | latin1 | cp1252 West European | latin1_swedish_ci | 1 | +---------+-----------------------+--------------------+--------+ 6 rows in setQuery supported collations.
obclient> SHOW COLLATION; +--------------------+---------+-----+---------+----------+---------+ | Collation | Charset | Id | Default | Compiled | Sortlen | +--------------------+---------+-----+---------+----------+---------+ | utf8mb4_general_ci | utf8mb4 | 45 | Yes | Yes | 1 | | utf8mb4_bin | utf8mb4 | 46 | | Yes | 1 | | binary | binary | 63 | Yes | Yes | 1 | | gbk_chinese_ci | gbk | 28 | Yes | Yes | 1 | | gbk_bin | gbk | 87 | | Yes | 1 | | utf16_general_ci | utf16 | 54 | Yes | Yes | 1 | | utf16_bin | utf16 | 55 | | Yes | 1 | | utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 1 | | utf16_unicode_ci | utf16 | 101 | | Yes | 1 | | gb18030_chinese_ci | gb18030 | 248 | Yes | Yes | 1 | | gb18030_bin | gb18030 | 249 | | Yes | 1 | | latin1_swedish_ci | latin1 | 8 | Yes | Yes | 1 | | latin1_bin | latin1 | 47 | | Yes | 1 | +--------------------+---------+-----+---------+----------+---------+ 13 rows in setQuery the status of the current session.
obclient> SHOW SESSION STATUS; +-------------------+--------+ | Variable_name | Value | +-------------------+--------+ | Threads_connected | 16 | | Uptime | 945571 | +-------------------+--------+Query the definitions of privileges.
obclient> SHOW PRIVILEGES; +----------------+---------------------------------------+-------------------------------------------------------+ | Privilege | Context | Comment | +----------------+---------------------------------------+-------------------------------------------------------+ | Alter | Tables | To alter the table | | Create | Databases,Tables,Indexes | To create new databases and tables | | Create user | Server Admin | To create new users | | Create view | Tables | To create new views | | Delete | Tables | To delete existing rows | | Drop | Databases,Tables | To drop databases, tables, and views | | Grant option | Databases,Tables,Functions,Procedures | To give to other users those privileges you possess | | Index | Tables | To create or drop indexes | | Insert | Tables | To insert data into tables | | Process | Server Admin | To view the plain text of currently executing queries | | Select | Tables | To retrieve rows from table | | Show databases | Server Admin | To see all databases with SHOW DATABASES | | Show view | Tables | To see views with SHOW CREATE VIEW | | Super | Server Admin | To use KILL thread, SET GLOBAL, CHANGE MASTER, etc. | | Update | Tables | To update existing rows | | Usage | Server Admin | No privileges - allow connect only | +----------------+---------------------------------------+-------------------------------------------------------+Query objects in the recycle bin.
obclient> SHOW RECYCLEBIN; +---------------------------------+---------------+-------+----------------------------+ | OBJECT_NAME | ORIGINAL_NAME | TYPE | CREATETIME | +---------------------------------+---------------+-------+----------------------------+ | __recycle_$_10_1629093637659648 | t1 | TABLE | 2021-08-16 14:00:37.660550 | | __recycle_$_10_1629093721748992 | t1 | TABLE | 2021-08-16 14:02:01.748691 | +---------------------------------+---------------+-------+----------------------------+Query the created sequences.
obclient> CREATE SEQUENCE IF NOT EXISTS s3 ORDER CACHE 100 INCREMENT BY 3 MAXVALUE 99999999999; Query OK, 0 rows affected obclient> SHOW SEQUENCE LIKE 's%'; +------------------------+ | Sequences_in_test (s%) | +------------------------+ | s1 | | s2 | | s3 | +------------------------+ 3 rows in set obclient> SHOW SEQUENCE WHERE sequence_name='s3'; +-------------------+ | Sequences_in_test | +-------------------+ | s3 | +-------------------+ 1 row in set obclient> SHOW SEQUENCE; +-------------------+ | Sequences_in_test | +-------------------+ | a2 | | s1 | | s2 | | s3 | +-------------------+ 4 rows in setUse
SHOW TRACEto query the execution information of an SQL statement and output the results in the JSON format.obclient> SET ob_enable_show_trace = 1; Query OK, 0 rows affected obclient> CREATE TABLE t1(c1 INT,c2 INT,c3 INT); Query OK, 0 rows affected obclient> INSERT INTO t1 VALUES(1,1,1); Query OK, 1 rows affected obclient> INSERT INTO t1 VALUES(2,2,2); Query OK, 1 rows affected obclient> SELECT/*+PARALLEL(2)*/ COUNT(*) FROM t1; +----------+ | COUNT(*) | +----------+ | 2 | +----------+ 1 row in set obclient> SHOW TRACE FORMAT='JSON'\G *************************** 1. row *************************** ShowTraceJSON: [{"logs": null, "tags": [[{"sess_id": 3221487676}, {"action_name": ""}, {"module_name": ""}, {"client_info": ""}, {"receive_ts": 1686734801498147}, {"log_trace_id": "YB42AC1E87DE-0005FDE675EF77C4-0-0"}]], "elapse": 4716, "end_ts": "2023-06-14 17:26:41.502925", "parent": "0005fe13-8cac-6fd6-8035-4c299e621239", "span_id": "0005fe13-8cac-7061-6648-1148424d99fa", "start_ts": "2023-06-14 17:26:41.498209", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "com_query_process", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 4698, "end_ts": "2023-06-14 17:26:41.502914", "parent": "0005fe13-8cac-7061-6648-1148424d99fa", "span_id": "0005fe13-8cac-7068-d79c-9a1e3df2f09f", "start_ts": "2023-06-14 17:26:41.498216", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "mpquery_single_stmt", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"sql_text": "SHOW TRACE FORMAT='JSON'"}], [{"sql_id": "D2A6E68D54F4B888F9443FD4EABB490C"}, {"database_id": 500001}, {"plan_hash": 13465692160314901852}], [{"hit_plan": false}]], "elapse": 2623, "end_ts": "2023-06-14 17:26:41.500858", "parent": "0005fe13-8cac-7068-d79c-9a1e3df2f09f", "span_id": "0005fe13-8cac-707b-84fc-7259f7a5afa4", "start_ts": "2023-06-14 17:26:41.498235", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "sql_compile", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 5, "end_ts": "2023-06-14 17:26:41.498244", "parent": "0005fe13-8cac-707b-84fc-7259f7a5afa4", "span_id": "0005fe13-8cac-707f-c009-4663739d39ed", "start_ts": "2023-06-14 17:26:41.498239", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "pc_get_plan", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 2543, "end_ts": "2023-06-14 17:26:41.500841", "parent": "0005fe13-8cac-707b-84fc-7259f7a5afa4", "span_id": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "start_ts": "2023-06-14 17:26:41.498298", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "hard_parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 27, "end_ts": "2023-06-14 17:26:41.498327", "parent": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "span_id": "0005fe13-8cac-70bc-91c6-d074e4c11eb8", "start_ts": "2023-06-14 17:26:41.498300", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 777, "end_ts": "2023-06-14 17:26:41.499126", "parent": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "span_id": "0005fe13-8cac-70ed-8482-917a5e0c16e7", "start_ts": "2023-06-14 17:26:41.498349", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "resolve", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 855, "end_ts": "2023-06-14 17:26:41.500028", "parent": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "span_id": "0005fe13-8cac-7425-2af1-497b7573f962", "start_ts": "2023-06-14 17:26:41.499173", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "rewrite", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 477, "end_ts": "2023-06-14 17:26:41.500522", "parent": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "span_id": "0005fe13-8cac-778d-5e60-51648fcad206", "start_ts": "2023-06-14 17:26:41.500045", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "optimize", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 176, "end_ts": "2023-06-14 17:26:41.500712", "parent": "0005fe13-8cac-70ba-5c5c-1dbf433776e1", "span_id": "0005fe13-8cac-7978-2ba6-2d656301eaef", "start_ts": "2023-06-14 17:26:41.500536", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "code_generate", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 1980, "end_ts": "2023-06-14 17:26:41.502845", "parent": "0005fe13-8cac-7068-d79c-9a1e3df2f09f", "span_id": "0005fe13-8cac-7ac1-2183-d9f0749c518d", "start_ts": "2023-06-14 17:26:41.500865", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "sql_execute", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 21, "end_ts": "2023-06-14 17:26:41.500887", "parent": "0005fe13-8cac-7ac1-2183-d9f0749c518d", "span_id": "0005fe13-8cac-7ac2-cc2b-a9dcea52ac30", "start_ts": "2023-06-14 17:26:41.500866", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 1874, "end_ts": "2023-06-14 17:26:41.502770", "parent": "0005fe13-8cac-7ac1-2183-d9f0749c518d", "span_id": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "start_ts": "2023-06-14 17:26:41.500896", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "response_result", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 44, "end_ts": "2023-06-14 17:26:41.500947", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-7ae7-2357-70f9191525f2", "start_ts": "2023-06-14 17:26:41.500903", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "do_local_das_task", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"sql_id": "7F33FD22651F99E8AB2BAC5428623BCD"}, {"database_id": 201001}], [{"sql_text": "START TRANSACTION WITH CONSISTENT SNAPSHOT"}], [{"hit_plan": false}]], "elapse": 95, "end_ts": "2023-06-14 17:26:41.501466", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-7cbb-24eb-6fd68edef4b3", "start_ts": "2023-06-14 17:26:41.501371", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "sql_compile", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 5, "end_ts": "2023-06-14 17:26:41.501378", "parent": "0005fe13-8cac-7cbb-24eb-6fd68edef4b3", "span_id": "0005fe13-8cac-7cbd-d28e-243bd51c8f52", "start_ts": "2023-06-14 17:26:41.501373", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "pc_get_plan", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 53, "end_ts": "2023-06-14 17:26:41.501456", "parent": "0005fe13-8cac-7cbb-24eb-6fd68edef4b3", "span_id": "0005fe13-8cac-7cdb-6744-4e35d589f69e", "start_ts": "2023-06-14 17:26:41.501403", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "hard_parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 14, "end_ts": "2023-06-14 17:26:41.501418", "parent": "0005fe13-8cac-7cdb-6744-4e35d589f69e", "span_id": "0005fe13-8cac-7cdc-d22e-b917f1f800ac", "start_ts": "2023-06-14 17:26:41.501404", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 10, "end_ts": "2023-06-14 17:26:41.501446", "parent": "0005fe13-8cac-7cdb-6744-4e35d589f69e", "span_id": "0005fe13-8cac-7cfc-a422-4419ea2a8f67", "start_ts": "2023-06-14 17:26:41.501436", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "resolve", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 32, "end_ts": "2023-06-14 17:26:41.501531", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-7d3b-4877-b72cd0df1355", "start_ts": "2023-06-14 17:26:41.501499", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 22, "end_ts": "2023-06-14 17:26:41.501522", "parent": "0005fe13-8cac-7d3b-4877-b72cd0df1355", "span_id": "0005fe13-8cac-7d3c-4373-3698da80bc1d", "start_ts": "2023-06-14 17:26:41.501500", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "cmd_open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"trans_id": 0}]], "elapse": 1, "end_ts": "2023-06-14 17:26:41.501502", "parent": "0005fe13-8cac-7d3c-4373-3698da80bc1d", "span_id": "0005fe13-8cac-7d3d-8ba4-00096f64fb96", "start_ts": "2023-06-14 17:26:41.501501", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "end_transaction", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 2, "end_ts": "2023-06-14 17:26:41.501552", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-7d6e-608e-1f9e19e7615d", "start_ts": "2023-06-14 17:26:41.501550", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 536, "end_ts": "2023-06-14 17:26:41.502144", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-7da8-8fe7-73d23fcb23bf", "start_ts": "2023-06-14 17:26:41.501608", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "inner_execute_read", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"sql_text": "SELECT svr_ip, svr_port, tenant_id, trace_id, request_id, span_id, parent_span_id, span_name, ref_type, start_ts, end_ts, tags, logs FROM __all_virtual_trace_span_info WHERE tenant_id = 1002 AND trace_id = '0005fe13-8bf2-47d5-2cdd-5d819739c997'"}], [{"sql_id": "9B307250A34F95FE531FDC05F9F87300"}, {"database_id": 201001}, {"plan_hash": 13345609059733987708}, {"hit_plan": true}]], "elapse": 96, "end_ts": "2023-06-14 17:26:41.501714", "parent": "0005fe13-8cac-7da8-8fe7-73d23fcb23bf", "span_id": "0005fe13-8cac-7db2-b9c2-ef1bdb1e916b", "start_ts": "2023-06-14 17:26:41.501618", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "sql_compile", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 68, "end_ts": "2023-06-14 17:26:41.501687", "parent": "0005fe13-8cac-7db2-b9c2-ef1bdb1e916b", "span_id": "0005fe13-8cac-7db3-0fc7-6c76f9923e90", "start_ts": "2023-06-14 17:26:41.501619", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "pc_get_plan", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 5, "end_ts": "2023-06-14 17:26:41.501730", "parent": "0005fe13-8cac-7da8-8fe7-73d23fcb23bf", "span_id": "0005fe13-8cac-7e1d-fffd-bb0c14004d0b", "start_ts": "2023-06-14 17:26:41.501725", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 35, "end_ts": "2023-06-14 17:26:41.501788", "parent": "0005fe13-8cac-7da8-8fe7-73d23fcb23bf", "span_id": "0005fe13-8cac-7e39-e47b-68b94d34b9f2", "start_ts": "2023-06-14 17:26:41.501753", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "do_local_das_task", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 32, "end_ts": "2023-06-14 17:26:41.502270", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-801e-95e9-f013f18e58ae", "start_ts": "2023-06-14 17:26:41.502238", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 12, "end_ts": "2023-06-14 17:26:41.502253", "parent": "0005fe13-8cac-801e-95e9-f013f18e58ae", "span_id": "0005fe13-8cac-8021-a2b8-efb5ea82362a", "start_ts": "2023-06-14 17:26:41.502241", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close_das_task", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 131, "end_ts": "2023-06-14 17:26:41.502419", "parent": "0005fe13-8cac-7ae0-063a-65a2b4aefdd6", "span_id": "0005fe13-8cac-8050-4e15-2c08b254c1a5", "start_ts": "2023-06-14 17:26:41.502288", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "inner_commit", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"sql_text": "COMMIT"}], [{"sql_id": "1D0BA376E273B9D622641124D8C59264"}, {"database_id": 201001}]], "elapse": 50, "end_ts": "2023-06-14 17:26:41.502344", "parent": "0005fe13-8cac-8050-4e15-2c08b254c1a5", "span_id": "0005fe13-8cac-8056-1325-2808b1b2c771", "start_ts": "2023-06-14 17:26:41.502294", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "sql_compile", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 43, "end_ts": "2023-06-14 17:26:41.502338", "parent": "0005fe13-8cac-8056-1325-2808b1b2c771", "span_id": "0005fe13-8cac-8057-68cd-3b71b27d0efc", "start_ts": "2023-06-14 17:26:41.502295", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "hard_parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 6, "end_ts": "2023-06-14 17:26:41.502302", "parent": "0005fe13-8cac-8057-68cd-3b71b27d0efc", "span_id": "0005fe13-8cac-8058-f520-2ec9b2347039", "start_ts": "2023-06-14 17:26:41.502296", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "parse", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 9, "end_ts": "2023-06-14 17:26:41.502328", "parent": "0005fe13-8cac-8057-68cd-3b71b27d0efc", "span_id": "0005fe13-8cac-806f-120c-2d223c5cafed", "start_ts": "2023-06-14 17:26:41.502319", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "resolve", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 31, "end_ts": "2023-06-14 17:26:41.502381", "parent": "0005fe13-8cac-8050-4e15-2c08b254c1a5", "span_id": "0005fe13-8cac-808e-48e0-16311abf387d", "start_ts": "2023-06-14 17:26:41.502350", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 26, "end_ts": "2023-06-14 17:26:41.502376", "parent": "0005fe13-8cac-808e-48e0-16311abf387d", "span_id": "0005fe13-8cac-808e-d038-2dd226a767c8", "start_ts": "2023-06-14 17:26:41.502350", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "cmd_open", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"trans_id": 638124}]], "elapse": 15, "end_ts": "2023-06-14 17:26:41.502366", "parent": "0005fe13-8cac-808e-d038-2dd226a767c8", "span_id": "0005fe13-8cac-808f-c5be-0aea9943a94e", "start_ts": "2023-06-14 17:26:41.502351", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "end_transaction", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 1, "end_ts": "2023-06-14 17:26:41.502394", "parent": "0005fe13-8cac-8050-4e15-2c08b254c1a5", "span_id": "0005fe13-8cac-80b9-b0dc-197d3c4b2ffd", "start_ts": "2023-06-14 17:26:41.502393", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 55, "end_ts": "2023-06-14 17:26:41.502838", "parent": "0005fe13-8cac-7ac1-2183-d9f0749c518d", "span_id": "0005fe13-8cac-823f-9393-a4c4d9ef623d", "start_ts": "2023-06-14 17:26:41.502783", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": null, "elapse": 5, "end_ts": "2023-06-14 17:26:41.502789", "parent": "0005fe13-8cac-823f-9393-a4c4d9ef623d", "span_id": "0005fe13-8cac-8240-73a1-98f019c5455a", "start_ts": "2023-06-14 17:26:41.502784", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "close_das_task", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}, {"logs": null, "tags": [[{"trans_id": 0}]], "elapse": 3, "end_ts": "2023-06-14 17:26:41.502828", "parent": "0005fe13-8cac-823f-9393-a4c4d9ef623d", "span_id": "0005fe13-8cac-8269-cc9b-b89fe9a1cda3", "start_ts": "2023-06-14 17:26:41.502825", "trace_id": "0005fe13-8cac-6fd6-0b2a-658fb95ee88f", "span_name": "end_transaction", "tenant_id": 1002, "rec_svr_ip": "172.xx.xxx.xxx", "rec_svr_port": 2882}] 1 row in setUse
SHOW COLUMNSto query information about columns in Tabletbl2.obclient> SHOW COLUMNS FROM tbl2;The query result is as follows:
+-------+---------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------+------+-----+---------+-------+ | a | int(11) | YES | | NULL | | | b | int(11) | YES | | NULL | | +-------+---------+------+-----+---------+-------+ 2 rows in setUse
SHOW EXTENDED COLUMNSto query information about hidden columns in Tabletbl2.obclient> SHOW EXTENDED COLUMNS FROM tbl2;The query result is as follows:
+----------------+-----------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+-----------------+------+-----+---------+-------+ | a | int(11) | YES | | NULL | | | b | int(11) | YES | | NULL | | | __pk_increment | bigint unsigned | NO | PRI | NULL | | +----------------+-----------------+------+-----+---------+-------+ 3 rows in setUse
SHOW INDEXto query information about indexes in Tabletbl2.obclient> SHOW INDEX FROM tbl2;The query result is as follows:
+-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression | +-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ | tbl2 | 1 | tbl2_index | 1 | a | A | NULL | NULL | NULL | YES | BTREE | available | | YES | NULL | | tbl2 | 1 | tbl2_index | 2 | b | A | NULL | NULL | NULL | YES | BTREE | available | | YES | NULL | +-------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ 2 rows in setUse
SHOW EXTENDED INDEXto query information about hidden indexes in Tabletbl2.obclient> SHOW EXTENDED INDEX FROM tbl2;The query result is as follows:
+-------+------------+------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ | Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment | Visible | Expression | +-------+------------+------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ | tbl2 | 0 | PRIMARY | 1 | __pk_increment | A | NULL | NULL | NULL | | BTREE | available | | YES | NULL | | tbl2 | 0 | PRIMARY | 2 | a | A | NULL | NULL | NULL | | BTREE | available | | YES | NULL | | tbl2 | 0 | PRIMARY | 3 | b | A | NULL | NULL | NULL | | BTREE | available | | YES | NULL | | tbl2 | 1 | tbl2_index | 1 | a | A | NULL | NULL | NULL | YES | BTREE | available | | YES | NULL | | tbl2 | 1 | tbl2_index | 2 | b | A | NULL | NULL | NULL | YES | BTREE | available | | YES | NULL | | tbl2 | 1 | tbl2_index | 3 | __pk_increment | A | NULL | NULL | NULL | | BTREE | available | | YES | NULL | +-------+------------+------------+--------------+----------------+-----------+-------------+----------+--------+------+------------+-----------+---------------+---------+------------+ 6 rows in set