(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 然后就这个服务挂了
dillon.wang:
``USER.mobileId
上面没有建索引么,执行一下DESC TAG USER看看
嗯columns里面没有mobileId 这个属性,创建索引的时候需要把要用来做索引查询的属性加进去。
那我的理解是,所有的对应的用到的属性,只要有用到的,都需要对属性 创建索引,是这样吗
不用,只要一个pattern 里面一个node pattern的属性有索引就行,你这个query查询条件涉及到User.mobileId,r1.first_callmak_on , r1.last_callmark_on等属性,可以考虑加上索引。
CREATE TAG INDEX user_index ON USER(mobileId(50))
rebuild失败