show stats语句中vertices和tag的数量对不上

提问参考模版:

  • nebula 版本:3.0.1
  • 部署方式:分布式
submit job status
+---------+-----------------+-----------+
| Type    | Name            | Count     |
+---------+-----------------+-----------+
| "Tag"   | "FileEntity"    | 888493    |
| "Tag"   | "ProcessEntity" | 2127059   |
| "Edge"  | "FileRead"      | 8392187   |
| "Edge"  | "FileWrite"     | 2111845   |
| "Edge"  | "ProcessFork"   | 3159496   |
| "Space" | "vertices"      | 459542358 |
| "Space" | "edges"         | 13663528  |
+---------+-----------------+-----------+

可以很明显的看出vertices并不等于两个tag之和,到底哪里出了问题?

一个 vertex 可以有多个 tag,也可以没有 tag 呀,所以它们的关系不是简单的相加关系。

有道理! 那追加一个问题,为什么我使用match (v)return v limit 10 没有任何返回结果呢?我该如何能查找出这些点

加一个 explain 看下执行计划

explain match (v) return v limit 10,顺便你的括号是中文字符下的(要执行的话记得改成英文的括号

不好意思 我上一个问题问的有点问题 :joy:,我是clear space之后使用的match语句,就是在tag edge都为0,只剩下vertices后使用的match,没有返回任何结果。(已经把括号修改为英文的)

补充一下执行的语句和结果

(l@nebula) [hips20]> show stats
+---------+-----------------+-----------+
| Type    | Name            | Count     |
+---------+-----------------+-----------+
| "Tag"   | "FileEntity"    | 0         |
| "Tag"   | "ProcessEntity" | 0         |
| "Edge"  | "FileRead"      | 0         |
| "Edge"  | "FileWrite"     | 0         |
| "Edge"  | "ProcessFork"   | 0         |
| "Space" | "vertices"      | 459622543 |
| "Space" | "edges"         | 0         |
+---------+-----------------+-----------+
Got 7 rows (time spent 801/1116 us)

Mon, 06 Feb 2023 14:50:44 CST

(l@nebula) [hips20]> match (v) return v limit 3
+---+
| v |
+---+
+---+
Empty set (time spent 6924710/6922840 us)

Mon, 06 Feb 2023 14:51:08 CST

(l@nebula) [hips20]> explain match (v) return v limit 3
Execution succeeded (time spent 325/642 us)

Execution Plan (optimize time 89 us)

-----+----------------+--------------+----------------+----------------------------------------------------------------------------
| id | name           | dependencies | profiling data | operator info                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------------------
|  8 | DataCollect    | 12           |                | outputVar: [                                                              |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "colNames": [                                                         |
|    |                |              |                |       "v"                                                                 |
|    |                |              |                |     ],                                                                    |
|    |                |              |                |     "type": "DATASET",                                                    |
|    |                |              |                |     "name": "__DataCollect_8"                                             |
|    |                |              |                |   }                                                                       |
|    |                |              |                | ]                                                                         |
|    |                |              |                | inputVar: [                                                               |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "colNames": [                                                         |
|    |                |              |                |       "v"                                                                 |
|    |                |              |                |     ],                                                                    |
|    |                |              |                |     "type": "DATASET",                                                    |
|    |                |              |                |     "name": "__Limit_7"                                                   |
|    |                |              |                |   }                                                                       |
|    |                |              |                | ]                                                                         |
|    |                |              |                | kind: ROW                                                                 |
-----+----------------+--------------+----------------+----------------------------------------------------------------------------
| 12 | Project        | 13           |                | outputVar: [                                                              |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "colNames": [                                                         |
|    |                |              |                |       "v"                                                                 |
|    |                |              |                |     ],                                                                    |
|    |                |              |                |     "type": "DATASET",                                                    |
|    |                |              |                |     "name": "__Limit_7"                                                   |
|    |                |              |                |   }                                                                       |
|    |                |              |                | ]                                                                         |
|    |                |              |                | inputVar: __Project_6                                                     |
|    |                |              |                | columns: [                                                                |
|    |                |              |                |   "$-.v AS v"                                                             |
|    |                |              |                | ]                                                                         |
-----+----------------+--------------+----------------+----------------------------------------------------------------------------
| 13 | Limit          | 14           |                | outputVar: [                                                              |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "colNames": [                                                         |
|    |                |              |                |       "v"                                                                 |
|    |                |              |                |     ],                                                                    |
|    |                |              |                |     "type": "DATASET",                                                    |
|    |                |              |                |     "name": "__Project_6"                                                 |
|    |                |              |                |   }                                                                       |
|    |                |              |                | ]                                                                         |
|    |                |              |                | inputVar: __AppendVertices_4                                              |
|    |                |              |                | offset: 0                                                                 |
|    |                |              |                | count: 3                                                                  |
-----+----------------+--------------+----------------+----------------------------------------------------------------------------
| 14 | AppendVertices | 15           |                | outputVar: [                                                              |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "colNames": [                                                         |
|    |                |              |                |       "v"                                                                 |
|    |                |              |                |     ],                                                                    |
|    |                |              |                |     "type": "DATASET",                                                    |
|    |                |              |                |     "name": "__AppendVertices_4"                                          |
|    |                |              |                |   }                                                                       |
|    |                |              |                | ]                                                                         |
|    |                |              |                | inputVar: __Filter_2                                                      |
|    |                |              |                | space: 42                                                                 |
|    |                |              |                | dedup: true                                                               |
|    |                |              |                | limit: 0                                                                  |
|    |                |              |                | filter:                                                                   |
|    |                |              |                | orderBy: []                                                               |
|    |                |              |                | src: $-._vid                                                              |
|    |                |              |                | props: [                                                                  |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "props": [                                                            |
|    |                |              |                |       "process_uuid",                                                     |
|    |                |              |                |       "pprocess_uuid",                                                    |
|    |                |              |                |       "host_uuid",                                                        |
|    |                |              |                |       "pid",                                                              |
|    |                |              |                |       "ppid",                                                             |
|    |                |              |                |       "processStartTs",                                                   |
|    |                |              |                |       "pprocessStartTs",                                                  |
|    |                |              |                |       "process_uid",                                                      |
|    |                |              |                |       "process_euid",                                                     |
|    |                |              |                |       "process_suid",                                                     |
|    |                |              |                |       "process_gid",                                                      |
|    |                |              |                |       "process_egid",                                                     |
|    |                |              |                |       "process_sgid",                                                     |
|    |                |              |                |       "process_cwd",                                                      |
|    |                |              |                |       "process_name",                                                     |
|    |                |              |                |       "process_cmdline",                                                  |
|    |                |              |                |       "container_id",                                                     |
|    |                |              |                |       "virtual_pid",                                                      |
|    |                |              |                |       "process_path",                                                     |
|    |                |              |                |       "file_uuid",                                                        |
|    |                |              |                |       "process_hash",                                                     |
|    |                |              |                |       "capability",                                                       |
|    |                |              |                |       "_tag"                                                              |
|    |                |              |                |     ],                                                                    |
|    |                |              |                |     "tagId": 43                                                           |
|    |                |              |                |   },                                                                      |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "props": [                                                            |
|    |                |              |                |       "file_uuid",                                                        |
|    |                |              |                |       "file_type",                                                        |
|    |                |              |                |       "host_uuid",                                                        |
|    |                |              |                |       "generationNumber",                                                 |
|    |                |              |                |       "dev_num",                                                          |
|    |                |              |                |       "inode_num",                                                        |
|    |                |              |                |       "file_path",                                                        |
|    |                |              |                |       "file_hash",                                                        |
|    |                |              |                |       "file_size",                                                        |
|    |                |              |                |       "file_format",                                                      |
|    |                |              |                |       "file_uid",                                                         |
|    |                |              |                |       "file_gid",                                                         |
|    |                |              |                |       "file_mode",                                                        |
|    |                |              |                |       "file_ctime",                                                       |
|    |                |              |                |       "file_mtime",                                                       |
|    |                |              |                |       "file_atime",                                                       |
|    |                |              |                |       "isHostFile",                                                       |
|    |                |              |                |       "_tag"                                                              |
|    |                |              |                |     ],                                                                    |
|    |                |              |                |     "tagId": 44                                                           |
|    |                |              |                |   }                                                                       |
|    |                |              |                | ]                                                                         |
|    |                |              |                | exprs:                                                                    |
|    |                |              |                | if_track_previous_path: false                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------------------
| 15 | ScanVertices   | 3            |                | outputVar: [                                                              |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "colNames": [                                                         |
|    |                |              |                |       "_vid",                                                             |
|    |                |              |                |       "FileEntity._tag",                                                  |
|    |                |              |                |       "ProcessEntity._tag"                                                |
|    |                |              |                |     ],                                                                    |
|    |                |              |                |     "type": "DATASET",                                                    |
|    |                |              |                |     "name": "__Filter_2"                                                  |
|    |                |              |                |   }                                                                       |
|    |                |              |                | ]                                                                         |
|    |                |              |                | inputVar:                                                                 |
|    |                |              |                | space: 42                                                                 |
|    |                |              |                | dedup: false                                                              |
|    |                |              |                | limit: 3                                                                  |
|    |                |              |                | filter: (FileEntity._tag IS NOT EMPTY OR ProcessEntity._tag IS NOT EMPTY) |
|    |                |              |                | orderBy: []                                                               |
|    |                |              |                | props: [                                                                  |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "props": [                                                            |
|    |                |              |                |       "_tag"                                                              |
|    |                |              |                |     ],                                                                    |
|    |                |              |                |     "tagId": 44                                                           |
|    |                |              |                |   },                                                                      |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "props": [                                                            |
|    |                |              |                |       "_tag"                                                              |
|    |                |              |                |     ],                                                                    |
|    |                |              |                |     "tagId": 43                                                           |
|    |                |              |                |   }                                                                       |
|    |                |              |                | ]                                                                         |
|    |                |              |                | exprs:                                                                    |
-----+----------------+--------------+----------------+----------------------------------------------------------------------------
|  3 | Start          |              |                | outputVar: [                                                              |
|    |                |              |                |   {                                                                       |
|    |                |              |                |     "colNames": [],                                                       |
|    |                |              |                |     "type": "DATASET",                                                    |
|    |                |              |                |     "name": "__Start_3"                                                   |
|    |                |              |                |   }                                                                       |
|    |                |              |                | ]                                                                         |
-----+----------------+--------------+----------------+----------------------------------------------------------------------------

有咩有可能,其实 vertex 已经没有了?你试试用 SUBMIT JOB STATS,这个 job 完成了,再执行下 show stats 呢?

已经尝试过了,还是存在vertices,并且match不到 :expressionless:

不是 submit job status,是 submit job stats。clear space 会删除 space 中的所有点和边,但不删除 schema,那么自然是 match 不到数据了。