无法查询,查询oom

  • nebula 版本:3.1
  • 部署方式:分布式
  • 安装方式: RPM
  • 是否为线上版本:Y
  • 硬件信息
    • 磁盘 ssd 3.5T
    • CPU 32core. 内存128g
  • 问题的具体描述
    执行match语句,机器直接oom,然后节点就挂了
    match (m:USER {mobileId: ‘6b908026b771006c93313d57ac340ecc5aca60e4d4da6c8c94571a25138ad645’}) OPTIONAL MATCH (m)-[r1:CALL_TO]-(x:MOBILE)-[:APPLY_FOR]->(a1:APPL)-[:APPLY_ON]-(t1:TIME) WHERE r1.first_callmark_on < 20220102 and r1.last_callmark_on > 20190102 and t1.TIME.date < ‘2022-01-02’ return count(x) as n_appl_1st_v4

这个应该怎么处理呢

能profile,或者explain看看么

这个不是你上面贴的query吧

如何查询我上面这个cypher任务的执行计划呢

还是用console看吧,别贴截图,直接贴文字

(root@nebula) [xygraph]> explain LOOKUP ON `USER` WHERE `USER`.mobileId == "6b908026b771006c93313d57ac340ecc5aca60e4d4da6c8c94571a25138ad645" YIELD id(vertex);

Execution succeeded (time spent 427/771 us)

Execution Plan (optimize time 193 us)

-----+------------------+--------------+----------------+-------------------------------------------------------------------------------------------------
| id | name             | dependencies | profiling data | operator info                                                                                  |
-----+------------------+--------------+----------------+-------------------------------------------------------------------------------------------------
|  3 | Project          | 2            |                | outputVar: {                                                                                   |
|    |                  |              |                |   "colNames": [                                                                                |
|    |                  |              |                |     "id(VERTEX)"                                                                               |
|    |                  |              |                |   ],                                                                                           |
|    |                  |              |                |   "type": "DATASET",                                                                           |
|    |                  |              |                |   "name": "__Project_3"                                                                        |
|    |                  |              |                | }                                                                                              |
|    |                  |              |                | inputVar: __Filter_2                                                                           |
|    |                  |              |                | columns: [                                                                                     |
|    |                  |              |                |   "id(VERTEX)"                                                                                 |
|    |                  |              |                | ]                                                                                              |
-----+------------------+--------------+----------------+-------------------------------------------------------------------------------------------------
|  2 | Filter           | 4            |                | outputVar: {                                                                                   |
|    |                  |              |                |   "colNames": [                                                                                |
|    |                  |              |                |     "_vid",                                                                                    |
|    |                  |              |                |     "USER._tag",                                                                               |
|    |                  |              |                |     "USER.coefficient",                                                                        |
|    |                  |              |                |     "USER.coefficient_ss",                                                                     |
|    |                  |              |                |     "USER.everappl",                                                                           |
|    |                  |              |                |     "USER.mobileId",                                                                           |
|    |                  |              |                |     "USER.rl_scr",                                                                             |
|    |                  |              |                |     "USER.triangle",                                                                           |
|    |                  |              |                |     "USER.triangle_ss",                                                                        |
|    |                  |              |                |     "USER.uid"                                                                                 |
|    |                  |              |                |   ],                                                                                           |
|    |                  |              |                |   "type": "DATASET",                                                                           |
|    |                  |              |                |   "name": "__Filter_2"                                                                         |
|    |                  |              |                | }                                                                                              |
|    |                  |              |                | inputVar: __TagIndexFullScan_1                                                                 |
|    |                  |              |                | condition: (USER.mobileId=="6b908026b771006c93313d57ac340ecc5aca60e4d4da6c8c94571a25138ad645") |
|    |                  |              |                | isStable: false                                                                                |
-----+------------------+--------------+----------------+-------------------------------------------------------------------------------------------------
|  4 | TagIndexFullScan | 0            |                | outputVar: {                                                                                   |
|    |                  |              |                |   "colNames": [                                                                                |
|    |                  |              |                |     "_vid",                                                                                    |
|    |                  |              |                |     "USER._tag",                                                                               |
|    |                  |              |                |     "USER.coefficient",                                                                        |
|    |                  |              |                |     "USER.coefficient_ss",                                                                     |
|    |                  |              |                |     "USER.everappl",                                                                           |
|    |                  |              |                |     "USER.mobileId",                                                                           |
|    |                  |              |                |     "USER.rl_scr",                                                                             |
|    |                  |              |                |     "USER.triangle",                                                                           |
|    |                  |              |                |     "USER.triangle_ss",                                                                        |
|    |                  |              |                |     "USER.uid"                                                                                 |
|    |                  |              |                |   ],                                                                                           |
|    |                  |              |                |   "type": "DATASET",                                                                           |
|    |                  |              |                |   "name": "__TagIndexFullScan_1"                                                               |
|    |                  |              |                | }                                                                                              |
|    |                  |              |                | inputVar:                                                                                      |
|    |                  |              |                | space: 1                                                                                       |
|    |                  |              |                | dedup: false                                                                                   |
|    |                  |              |                | limit: 9223372036854775807                                                                     |
|    |                  |              |                | filter:                                                                                        |
|    |                  |              |                | orderBy: []                                                                                    |
|    |                  |              |                | schemaId: 265                                                                                  |
|    |                  |              |                | isEdge: false                                                                                  |
|    |                  |              |                | returnCols: [                                                                                  |
|    |                  |              |                |   "_vid",                                                                                      |
|    |                  |              |                |   "_tag",                                                                                      |
|    |                  |              |                |   "coefficient",                                                                               |
|    |                  |              |                |   "coefficient_ss",                                                                            |
|    |                  |              |                |   "everappl",                                                                                  |
|    |                  |              |                |   "mobileId",                                                                                  |
|    |                  |              |                |   "rl_scr",                                                                                    |
|    |                  |              |                |   "triangle",                                                                                  |
|    |                  |              |                |   "triangle_ss",                                                                               |
|    |                  |              |                |   "uid"                                                                                        |
|    |                  |              |                | ]                                                                                              |
|    |                  |              |                | indexCtx: [                                                                                    |
|    |                  |              |                |   {                                                                                            |
|    |                  |              |                |     "columnHints": [],                                                                         |
|    |                  |              |                |     "filter": "",                                                                              |
|    |                  |              |                |     "index_id": 267                                                                            |
|    |                  |              |                |   }                                                                                            |
|    |                  |              |                | ]                                                                                              |
-----+------------------+--------------+----------------+-------------------------------------------------------------------------------------------------
|  0 | Start            |              |                | outputVar: {                                                                                   |
|    |                  |              |                |   "colNames": [],                                                                              |
|    |                  |              |                |   "type": "DATASET",                                                                           |
|    |                  |              |                |   "name": "__Start_0"                                                                          |
|    |                  |              |                | }                                                                                              |
-----+------------------+--------------+----------------+-------------------------------------------------------------------------------------------------

Mon, 24 Oct 2022 15:38:05 CST

那个执行计划太长了

这个也是一查询 就超时了,如果node几千 上万可以查出来 单独查节点 量多了上百万,上千万, 就查不出来,然后oom 然后就这个服务挂了

上面没有建索引么,执行一下DESC TAG USER看看

建了索引了

弄错了,执行下SHOW TAG INDEXES

columns里面没有mobileId 这个属性,创建索引的时候需要把要用来做索引查询的属性加进去。

那我的理解是,所有的对应的用到的属性,只要有用到的,都需要对属性 创建索引,是这样吗


那其实所有的都需要创建所有的复合索引是吗

不用,只要一个pattern 里面一个node pattern的属性有索引就行,你这个query查询条件涉及到User.mobileIdr1.first_callmak_onr1.last_callmark_on等属性,可以考虑加上索引。

CREATE TAG INDEX user_index ON USER(mobileId(50))

rebuild失败
image