SHOW Commands
TDengine provides SHOW commands for obtaining brief system information. For more detailed metadata, system information, and status, use SELECT to query tables in INFORMATION_SCHEMA (see Metadata Views) or performance statistics views in PERFORMANCE_SCHEMA (see Performance Data Views).
The SHOW statements supported by the current version are listed below in alphabetical order by command name.
SHOW ALIVE
SHOW [db_name.]ALIVE;
Queries whether the specified database is available. If no database name is specified, queries the current database. The return values have the same meanings as those of SHOW CLUSTER ALIVE: 0 means unavailable, 1 means fully available, and 2 means partially available.
SHOW ANODES
SHOW ANODES;
SHOW ANODES FULL;
Displays information about analysis nodes (anodes). SHOW ANODES FULL additionally displays details about the algorithms loaded on each node. For the complete set of fields, see INS_ANODES / INS_ANODES_FULL.
SHOW APPS
SHOW APPS;
Displays information about applications (clients) connected to the cluster. For the complete set of fields, see PERF_APPS.
SHOW ARBGROUPS
SHOW ARBGROUPS;
Displays information about arbitration groups (arbgroups), including replica dnode information, synchronization status, and assigned tokens. For the complete set of fields, see INS_ARBGROUPS.
SHOW BNODES
SHOW BNODES;
Displays information about bridge nodes (bnodes). For the complete set of fields, see INS_BNODES.
SHOW CLUSTER
SHOW CLUSTER;
Displays information about the current cluster. For the complete set of fields, see INS_CLUSTER.
SHOW CLUSTER ALIVE
SHOW CLUSTER ALIVE;
Queries whether the current cluster is available. The return values are as follows:
0: Unavailable1: Fully available2: Partially available (some nodes are offline, but the other nodes remain available)
SHOW CLUSTER MACHINES
SHOW CLUSTER MACHINES;
Displays cluster machine codes and related information. For the complete set of fields, see INS_MACHINES.
Notes
- Enterprise Edition only
- Available since
v3.2.3.0
SHOW CLUSTER VARIABLES
SHOW VARIABLES [LIKE 'pattern'];
SHOW CLUSTER VARIABLES [LIKE 'pattern'];
SHOW DNODE dnode_id VARIABLES [LIKE 'pattern'];
Displays the runtime values of configuration parameters that must remain consistent across nodes. You can also specify a dnode to view its configuration. Use LIKE to filter by parameter name. SHOW VARIABLES and SHOW CLUSTER VARIABLES are equivalent.
Notes
- Before
v3.0.1.6, onlySHOW VARIABLESwas supported.
SHOW COMPACTS
SHOW COMPACTS;
SHOW COMPACT compact_id;
Displays the list of data compaction tasks. SHOW COMPACT compact_id displays detailed progress for the specified task on each vgroup/dnode. For the complete set of fields, see INS_COMPACTS / INS_COMPACT_DETAILS.
SHOW CONNECTIONS
SHOW CONNECTIONS;
Displays information about connections in the current system. For the complete set of fields, see PERF_CONNECTIONS.
SHOW CONSUMERS
SHOW CONSUMERS;
Displays information about all consumers in the current database. For the complete set of fields, see PERF_CONSUMERS.
SHOW CPU_ALLOCATION
SHOW CPU_ALLOCATION;
Displays the CPU core allocation status of the three thread categories (management, write, and read) on all dnodes in the cluster. This information is meaningful only when the enableCpuAffinity configuration parameter is enabled. Each dnode returns three rows with the following columns:
| Column Name | Data Type | Description |
|---|---|---|
dnode_id | INT | dnode identifier |
thread_category | VARCHAR(16) | Thread category: management, write, or read |
cores | INT | Number of CPU cores allocated to this category (0 when disabled) |
core_ids | VARCHAR(256) | Comma-separated list of assigned core IDs; "-" when disabled |
enabled | BOOL | Whether CPU affinity is enabled for this category |
When enableCpuAffinity is disabled (the default), all rows show enabled=false, cores=0, and core_ids="-". For the complete set of fields, see INS_CPU_ALLOCATION.
SHOW CREATE DATABASE
SHOW CREATE DATABASE db_name;
Displays the creation statement for the database specified by db_name.
SHOW CREATE RSMA
SHOW CREATE RSMA [db_name.]rsma_name;
Displays the creation statement for the specified RSMA.
SHOW CREATE STABLE
SHOW CREATE STABLE [db_name.]stb_name;
Displays the creation statement for the supertable specified by stb_name.
SHOW CREATE STREAM
SHOW CREATE STREAM [db_name.]stream_name;
Displays the creation statement for the stream specified by stream_name.
Notes
- Available since
v3.4.1.13
SHOW CREATE TABLE
SHOW CREATE TABLE [db_name.]tb_name;
Displays the creation statement for the table specified by tb_name. Normal tables, supertables, and subtables are supported.
SHOW CREATE VIEW
SHOW CREATE VIEW [db_name.]view_name;
Displays the creation statement for the specified view.
SHOW CREATE VTABLE
SHOW CREATE VTABLE [db_name.]vtable_name;
Displays the creation statement for a virtual table. For virtual subtables that use tag references, the result preserves the corresponding tag reference definitions.
SHOW DATABASES
SHOW [USER | SYSTEM] DATABASES;
Displays the list of databases. SYSTEM displays only system databases, and USER displays only user-created databases. For the complete set of fields, see INS_DATABASES.
SHOW DISK_INFO
SHOW [db_name.]DISK_INFO;
Displays database disk usage information, including WAL, multi-tier storage, cache, and metadata usage. For the complete set of fields, see INS_DISK_USAGE.
SHOW DNODES
SHOW DNODES;
Displays information about dnodes in the current system. For the complete set of fields, see INS_DNODES.
SHOW ENCRYPTIONS
SHOW ENCRYPTIONS;
Displays the encryption key status of each dnode. For the complete set of fields, see INS_ENCRYPTIONS.
SHOW ENCRYPT_ALGORITHMS
SHOW ENCRYPT_ALGORITHMS;
Displays the list of available encryption algorithms. For the complete set of fields, see INS_ENCRYPT_ALGORITHMS.
SHOW ENCRYPT_STATUS
SHOW ENCRYPT_STATUS;
Displays the current encryption scope, algorithm, and status. For the complete set of fields, see INS_ENCRYPT_STATUS.
SHOW EXTERNAL SOURCES
SHOW EXTERNAL SOURCES;
Displays information about external data sources for federated queries. For the complete set of fields, see INS_EXT_SOURCES.
SHOW FUNCTIONS
SHOW FUNCTIONS;
Displays user-defined functions. For the complete set of fields, see INS_FUNCTIONS.
SHOW INDEXES
SHOW INDEXES FROM tbl_name [FROM db_name];
SHOW INDEXES FROM [db_name.]tbl_name;
Displays created indexes. For the complete set of fields, see INS_INDEXES.
SHOW INSTANCES
SHOW INSTANCES [LIKE 'pattern'];
Displays registration information for instances connected to the cluster. For the complete set of fields, see PERF_INSTANCES.
SHOW LICENCES
SHOW LICENCES;
SHOW GRANTS;
SHOW GRANTS FULL;
SHOW GRANTS LOGS;
Displays Enterprise Edition license authorization information. SHOW LICENCES and SHOW GRANTS are equivalent. SHOW GRANTS FULL displays details of authorization items, and SHOW GRANTS LOGS displays authorization-related logs. For the complete set of fields, see INS_GRANTS / INS_GRANTS_FULL / INS_GRANTS_LOGS.
Notes
- Enterprise Edition only
SHOW GRANTS FULLis available sincev3.2.3.0
SHOW LOCAL VARIABLES
SHOW LOCAL VARIABLES [LIKE 'pattern'];
Displays the runtime values of configuration parameters for the current client. Use LIKE to filter by parameter name.
SHOW MNODES
SHOW MNODES;
Displays information about mnodes in the current system. For the complete set of fields, see INS_MNODES.
SHOW MOUNTS
SHOW MOUNTS;
Displays database mount information. For the complete set of fields, see INS_MOUNTS.
SHOW QNODES
SHOW QNODES;
Displays information about qnodes (query nodes) in the current system. For the complete set of fields, see INS_QNODES.
SHOW QUERIES
SHOW QUERIES;
Displays information about ongoing write (update), query, and delete operations in the current system. These operations are collectively called QUERIES because of internal API naming. For the complete set of fields, see PERF_QUERIES.
SHOW RETENTIONS
SHOW [db_name.]RETENTIONS;
SHOW RETENTION retention_id;
Displays the list of data retention tasks. SHOW RETENTION retention_id displays details of the specified task. For the complete set of fields, see INS_RETENTIONS / INS_RETENTION_DETAILS.
SHOW ROLE COLUMN PRIVILEGES
SHOW ROLE COLUMN PRIVILEGES;
Displays role column-level privileges. For the complete set of fields, see INS_ROLE_COLUMN_PRIVILEGES.
SHOW ROLE PRIVILEGES
SHOW ROLE PRIVILEGES;
Displays role privilege details. For the complete set of fields, see INS_ROLE_PRIVILEGES.
SHOW ROLES
SHOW ROLES;
Displays the list of roles. For the complete set of fields, see INS_ROLES.
SHOW RSMAS
SHOW [db_name.]RSMAS;
Displays RSMA definition information. For the complete set of fields, see INS_RSMAS.
SHOW SCANS
SHOW SCANS;
SHOW SCAN scan_id;
Displays the list of data scan tasks. SHOW SCAN scan_id displays details of the specified task. For the complete set of fields, see INS_SCANS / INS_SCAN_DETAILS.
SHOW SCORES
SHOW SCORES;
Displays information about the capacity authorized by the system license.
Notes
- Enterprise Edition only
SHOW SECURITY_POLICIES
SHOW SECURITY_POLICIES;
Displays security policy definitions. For the complete set of fields, see INS_SECURITY_POLICIES.
SHOW SNODES
SHOW SNODES;
Displays information about snodes (stream processing nodes) in the current system. For the complete set of fields, see INS_SNODES.
SHOW SSMIGRATES
SHOW SSMIGRATES;
Displays the progress of shared-storage migration tasks. For the complete set of fields, see INS_SSMIGRATES.
SHOW STABLES
SHOW [NORMAL | CHILD | VIRTUAL] [db_name.]STABLES [LIKE 'pattern'];
Displays supertables in the current database. Use LIKE for fuzzy matching by table name. Use the optional NORMAL, CHILD, or VIRTUAL keyword to filter by type. For the complete set of fields, see INS_STABLES.
SHOW STREAMS
SHOW [db_name.]STREAMS [LIKE 'pattern'];
Displays stream processing information. If no database is specified, displays streams in all databases. Use LIKE for fuzzy matching by stream name. For the complete set of fields, see INS_STREAMS.
SHOW SUBSCRIPTIONS
SHOW SUBSCRIPTIONS;
Displays all subscription relationships in the current system. For the complete set of fields, see INS_SUBSCRIPTIONS.
SHOW TABLE DISTRIBUTED
SHOW TABLE DISTRIBUTED [db_name.]table_name;
Displays table data distribution information. For the complete set of fields, see INS_TABLE_FIXED_DISTRIBUTED.
Example
Statement: SHOW TABLE DISTRIBUTED d0\G; (vertically displays the BLOCK distribution of table d0)
Display example
*************************** 1.row ***************************
_block_dist: Total_Blocks=[5] Total_Size=[93.65 KB] Average_size=[18.73 KB] Compression_Ratio=[23.98 %]
Total_Blocks: Table d0 occupies 5 blocks
Total_Size: All blocks of table d0 occupy 93.65 KB in the file
Average_size: Each block occupies an average of 18.73 KB in the file
Compression_Ratio: Data compression ratio: 23.98%
*************************** 2.row ***************************
_block_dist: Total_Rows=[20000] Inmem_Rows=[0] MinRows=[3616] MaxRows=[4096] Average_Rows=[4000]
Total_Rows: Table d0 has 20,000 rows stored on disk (this value is for reference only and is not an exact row count. Use the count function to obtain an exact row count)
Inmem_Rows: Number of data rows stored in the write cache (not persisted to disk); 0 rows means that there is no data in the memory cache
MinRows: The minimum number of rows in a BLOCK, which is 3,616
MaxRows: The maximum number of rows in a BLOCK, which is 4,096
Average_Rows: The average number of rows in each BLOCK, which is 4,000
*************************** 3.row ***************************
_block_dist: Total_Tables=[1] Total_Files=[2] Total_Vgroups=[1]
Total_Tables: Number of subtables, which is 1 here
Total_Files: Number of data files in which the table data is stored, which is 2 here
Total_Vgroups: Number of virtual nodes (vnodes) across which the table data is distributed
*************************** 5.row ***************************
_block_dist: 0100 |
*************************** 6.row ***************************
_block_dist: 0299 |
......
*************************** 22.row ***************************
_block_dist: 3483 ||||||||||||||||| 1 (20.00%)
*************************** 23.row ***************************
_block_dist: 3682 |
*************************** 24.row ***************************
_block_dist: 3881 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 4 (80.00%)
Query OK, 24 row(s) in set (0.002444s)
The preceding example illustrates the distribution of the number of data rows in blocks. 0100, 0299, 0498, and so on represent ranges of data row counts in each block. In this example, the table has five blocks: one block (about 20%) falls in the range from 3483 to 3681 rows, and four blocks (about 80%) fall in the range from 3881 to 4096 rows (the maximum number of rows). The other ranges contain no blocks.
Only data block information in data files is displayed. Data in stt files is not included.
SHOW TABLE TAGS
SHOW TABLE TAGS [tag_name [, ...]] FROM table_name [FROM db_name];
SHOW TABLE TAGS [tag_name [, ...]] FROM [db_name.]table_name;
Displays tag values for a supertable/subtable as columns. You can specify the tag columns to display. Unlike SHOW TAGS, this command is more suitable for viewing a projection of selected tag columns.
SHOW TABLES
SHOW [NORMAL | CHILD | VIRTUAL] [db_name.]TABLES [LIKE 'pattern'];
Displays normal tables and subtables in the current database. Use LIKE for fuzzy matching by table name. NORMAL displays only normal tables, CHILD displays only subtables, and VIRTUAL displays only virtual-table-related objects. To display virtual normal tables and virtual subtables, prefer SHOW VTABLES. For the complete set of fields, see INS_TABLES.
SHOW TAGS
SHOW TAGS FROM child_table_name [FROM db_name];
SHOW TAGS FROM [db_name.]child_table_name;
Displays tag information for a subtable. For a virtual subtable that uses tag references, the result contains the currently resolved tag values. For the complete set of fields, see INS_TAGS.
SHOW TOKENS
SHOW TOKENS;
Displays user access token information. For the complete set of fields, see INS_TOKENS.
SHOW TOPICS
SHOW TOPICS;
Displays information about all topics in the current database. For the complete set of fields, see INS_TOPICS.
SHOW TRANSACTION LOGS
SHOW TRANSACTION LOGS;
Displays the history of completed metadata transactions. For the complete set of fields, see INS_TRANSACTION_LOGS.
SHOW TRANSACTION ORPHANS
SHOW TRANSACTION ORPHANS;
Displays orphan transaction detection results. For the complete set of fields, see INS_TRANSACTION_ORPHANS.
SHOW TRANSACTIONS
SHOW TRANSACTIONS;
SHOW TRANSACTION transaction_id;
SHOW TRANSACTIONS displays the list of metadata transactions currently being executed (for metadata-level operations other than normal-table operations). SHOW TRANSACTION transaction_id displays action details for the specified transaction, corresponding to INS_TRANSACTION_DETAILS. For the complete list fields, see INS_TRANSACTIONS / PERF_TRANS.
SHOW TSMAS
SHOW [db_name.]TSMAS;
Displays time-series SMA (TSMA) definition information. For the complete set of fields, see INS_TSMAS.
SHOW USER PRIVILEGES
SHOW USER PRIVILEGES;
Displays user privilege details. For the complete set of fields, see INS_USER_PRIVILEGES.
SHOW USERS
SHOW USERS;
SHOW USERS FULL;
Displays all users in the current system. SHOW USERS FULL returns more complete user security and policy configuration. For the complete set of fields, see INS_USERS / INS_USERS_FULL.
SHOW VGROUPS
SHOW [db_name.]VGROUPS;
Displays information about all vgroups in the current database. For the complete set of fields, see INS_VGROUPS.
SHOW VIEWS
SHOW [db_name.]VIEWS [LIKE 'pattern'];
Displays the list of views. For the complete set of fields, see INS_VIEWS.
SHOW VNODES
SHOW VNODES;
SHOW VNODES ON DNODE dnode_id;
Displays information about all vnodes in the current system or the vnodes on a specified dnode. For the complete set of fields, see INS_VNODES.
SHOW VTABLE INHERITS
SHOW VTABLE INHERITS;
Displays virtual supertable inheritance relationships. For the complete set of fields, see INS_VSTABLE_INHERITS.
SHOW VTABLE VALIDATE
SHOW VTABLE VALIDATE FOR [db_name.]vtable_name;
Validates column/tag reference relationships for a virtual normal table or virtual subtable. To query validation results in batches, query INS_VIRTUAL_TABLES_REFERENCING.
SHOW VTABLES
SHOW [NORMAL | CHILD | VIRTUAL] [db_name.]VTABLES [LIKE 'pattern'];
Displays virtual normal tables and virtual subtables in the specified database. SHOW TABLES does not return these objects through the virtual-table view by default. Use this command to display them.
SHOW XNODE AGENTS
SHOW XNODE AGENTS [WHERE condition];
SHOW XNODE AGENT [WHERE condition];
Displays Xnode Agent information. For the complete set of fields, see INS_XNODE_AGENTS.
SHOW XNODE JOBS
SHOW XNODE JOBS [WHERE condition];
SHOW XNODE JOB [WHERE condition];
Displays Xnode Job shard information. For the complete set of fields, see INS_XNODE_JOBS.
SHOW XNODE TASKS
SHOW XNODE TASKS [WHERE condition];
SHOW XNODE TASK [WHERE condition];
Displays information about Xnode data ingestion tasks. For the complete set of fields, see INS_XNODE_TASKS.
SHOW XNODES
SHOW XNODES [WHERE condition];
Displays information about Xnode data ingestion nodes. For the complete set of fields, see INS_XNODES.