> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW DATA

> SHOW DATA is used to display the amount of data, the number of copies, and the number of statistical rows in a database or a database table.

## 功能

用于查看指定数据库或指定表的数据量、副本数量以及统计行数。

## 语法

```sql theme={null}
SHOW DATA [FROM <db_name>[.<table_name>]]
```

说明：

1. 如果不指定 FROM 子句，则展示当前 db 下细分到各个 table 的数据量和副本数量。其中数据量为所有副本的总数据量。而副本数量为表的所有分区以及所有物化视图的副本数量。

2. 如果指定 FROM 子句，则展示 table 下细分到各个物化视图的数据量、副本数量和统计行数。其中数据量为所有副本的总数据量。副本数量为对应物化视图的所有分区的副本数量。统计行数为对应物化视图的所有分区统计行数。

3. 统计行数时，以多个副本中，行数最大的那个副本为准。

4. 结果集中的 `Total` 行表示汇总行。`Quota` 行表示当前数据库设置的配额。`Left` 行表示剩余配额。

5. 如果想查看各个 Partition 的大小，请参阅 [show partitions](/documents/cn/4.2/sql-reference/sql-statements/table_bucket_part_index/SHOW_PARTITIONS.md)。

## 示例

### 查看数据库下表的总数据量

查看当前数据库下各个 table 的数据量，副本数量，汇总数据量和汇总副本数量。

```sql theme={null}
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   |
+-----------+-------------+--------------+
```

### 查看某个表的数据量

查看指定数据库下指定表的细分数据量、副本数量和统计行数。

```sql theme={null}
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           |          |
+-----------+-----------+-----------+--------------+----------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.