跳转至

SHOW STATS

SHOW STATS语句显示最近一次SUBMIT JOB STATS作业收集的图空间统计信息。

图空间统计信息包含:

  • 点的总数
  • 边的总数
  • 每个 Tag 关联的点的总数
  • 每个 Edge type 关联的边的总数

Warning

SHOW STATS返回的不是实时数据。因为返回的数据是最近一次 SUBMIT JOB STATS 作业收集的数据。返回的数据可能包含 TTL 过期数据,该过期数据会在下次执行 Compaction 操作时被删除并不纳入统计。

前提条件

在需要查看统计信息的图空间中执行SUBMIT JOB STATS。详情请参见 SUBMIT JOB STATS

Caution

SHOW STATS的结果取决于最后一次执行的SUBMIT JOB STATS。如果发生过新的写入或者更改,必须再次执行SUBMIT JOB STATS,否则统计数据有错误。

语法

SHOW STATS;

示例

# 选择图空间。
nebula> USE basketballplayer;

# 执行 SUBMIT JOB STATS。
nebula> SUBMIT JOB STATS;
+------------+
| New Job Id |
+------------+
| 98         |
+------------+

# 确认作业执行成功。
nebula> SHOW JOB 98;
+----------------+---------------+------------+----------------------------+----------------------------+-------------+
| Job Id(TaskId) | Command(Dest) | Status     | Start Time                 | Stop Time                  | Error Code  |
+----------------+---------------+------------+----------------------------+----------------------------+-------------+
| 98             | "STATS"       | "FINISHED" | 2021-11-01T09:33:21.000000 | 2021-11-01T09:33:21.000000 | "SUCCEEDED" |
| 0              | "storaged2"   | "FINISHED" | 2021-11-01T09:33:21.000000 | 2021-11-01T09:33:21.000000 | "SUCCEEDED" |
| 1              | "storaged0"   | "FINISHED" | 2021-11-01T09:33:21.000000 | 2021-11-01T09:33:21.000000 | "SUCCEEDED" |
| 2              | "storaged1"   | "FINISHED" | 2021-11-01T09:33:21.000000 | 2021-11-01T09:33:21.000000 | "SUCCEEDED" |
| "Total:3"      | "Succeeded:3" | "Failed:0" | "In Progress:0"            | ""                         | ""          |
+----------------+---------------+------------+----------------------------+----------------------------+-------------+

# 显示图空间统计信息。
nebula> SHOW STATS;
+---------+------------+-------+
| Type    | Name       | Count |
+---------+------------+-------+
| "Tag"   | "player"   | 51    |
| "Tag"   | "team"     | 30    |
| "Edge"  | "follow"   | 81    |
| "Edge"  | "serve"    | 152   |
| "Space" | "vertices" | 81    |
| "Space" | "edges"    | 233   |
+---------+------------+-------+

最后更新: December 1, 2022