SHOW-DATA
SHOW-DATA
Name
SHOW DATA
Description
This statement is used to display the amount of data, the number of replicas, and the number of statistical rows.
grammar:
SHOW DATA [FROM [db_name.]table_name] [ORDER BY ...];
illustrate:
If the FROM clause is not specified, the data volume and number of replicas subdivided into each table under the current db will be displayed. The data volume is the total data volume of all replicas. The number of replicas is the number of replicas for all partitions of the table and all materialized views.
If the FROM clause is specified, the data volume, number of copies and number of statistical rows subdivided into each materialized view under the table will be displayed. The data volume is the total data volume of all replicas. The number of replicas is the number of replicas for all partitions of the corresponding materialized view. The number of statistical rows is the number of statistical rows for all partitions of the corresponding materialized view.
When counting the number of rows, the one with the largest number of rows among the multiple copies shall prevail.
The
Total
row in the result set represents the total row. TheQuota
line represents the quota set by the current database. TheLeft
line indicates the remaining quota.If you want to see the size of each Partition, see
help show partitions
.You can use ORDER BY to sort on any combination of columns.
Example
Display the data size and RecycleBin size of each database by default.
SHOW DATA;
+-------+-----------------------------------+--------+------------+-------------+-------------------+
| DbId | DbName | Size | RemoteSize | RecycleSize | RecycleRemoteSize |
+-------+-----------------------------------+--------+------------+-------------+-------------------+
| 21009 | db1 | 0 | 0 | 0 | 0 |
| 22011 | regression_test_inverted_index_p0 | 72764 | 0 | 0 | 0 |
| 0 | information_schema | 0 | 0 | 0 | 0 |
| 22010 | regression_test | 0 | 0 | 0 | 0 |
| 1 | mysql | 0 | 0 | 0 | 0 |
| 22017 | regression_test_show_p0 | 0 | 0 | 0 | 0 |
| 10002 | __internal_schema | 46182 | 0 | 0 | 0 |
| Total | NULL | 118946 | 0 | 0 | 0 |
+-------+-----------------------------------+--------+------------+-------------+-------------------+Display the data volume, replica number, aggregate data volume and aggregate replica number of each table in a database.
USE db1;
SHOW DATA;+-----------+-------------+--------------+
| TableName | Size | ReplicaCount |
+-----------+-------------+--------------+
| tbl1 | 900.000 B | 6 |
| tbl2 | 500.000 B | 3 |
| Total | 1.400 KB | 9 |
| Quota | 1024.000 GB | 1073741824 |
| Left | 1021.921 GB | 1073741815 |
+-----------+-------------+--------------+Display the subdivided data volume, the number of replicas and the number of statistical rows of the specified table under the specified db
SHOW DATA FROM example_db.test;
+-----------+-----------+-----------+--------------+----------+
| TableName | IndexName | Size | ReplicaCount | RowCount |
+-----------+-----------+-----------+--------------+----------+
| test | r1 | 10.000MB | 30 | 10000 |
| | r2 | 20.000MB | 30 | 20000 |
| | test2 | 50.000MB | 30 | 50000 |
| | Total | 80.000 | 90 | |
+-----------+-----------+-----------+--------------+----------+It can be combined and sorted according to the amount of data, the number of copies, the number of statistical rows, etc.
SHOW DATA ORDER BY ReplicaCount desc,Size asc;
+-----------+-------------+--------------+
| TableName | Size | ReplicaCount |
+-----------+-------------+--------------+
| table_c | 3.102 KB | 40 |
| table_d | .000 | 20 |
| table_b | 324.000 B | 20 |
| table_a | 1.266 KB | 10 |
| Total | 4.684 KB | 90 |
| Quota | 1024.000 GB | 1073741824 |
| Left | 1024.000 GB | 1073741734 |
+-----------+-------------+--------------+
Keywords
SHOW, DATA